Question: CSc 2720-Data Structures: Lab 4 How to Submit Queue Stack: Please submit your answers in icollege once you have completed Failure to submit will result
CSc 2720-Data Structures: Lab 4 How to Submit Queue Stack: Please submit your answers in icollege once you have completed Failure to submit will result in a zero for this lab. Front Back Problem 1: A palindrome is a string of characters that reads the same from left to right as it does from right to left. Write a function called checkPalindrome that takes a string s1 andevaluate ifthe string is a palindrome or not using only a stack and a queue data structures. You should make use of the built-in java implementation of the stack and queue data structure under java.util.Stack and java.util.Queue Example 1: Input: S1 "radar" Output: true Example 2 Input: si "Hit TheRoadJack Output: false -.-Function import java.util.Stack; import java.util.LinkedList; import java.util.Queue; public class Lab4 ( public static void main (String[] args)f String s1 -radar"; boolean ans checkPalindrome (s1); System.out.println(ans); II Should be True public static boolean checkPalindrome (String si) Stack
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
