Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( A ) Implement generic class ArrayStack as discussed in the lectures having following methods: constructor, push, pop, peek, isEmpty, copy constructor, reallocate ( private

(A) Implement generic class ArrayStack as discussed in the lectures having following methods:
constructor, push, pop, peek, isEmpty, copy constructor, reallocate (private method).
Also add following methods to this class:
size: returns number of elements in the stack.
contains: Search an element in the stack. If found returns true, else returns false.
clear: Deletes all elements of the stack and make it empty stack.
(B) Implement generic class ArrayQueue as discussed in the lectures having following methods:
constructor, copy constructor, offer, poll, peek, isEmpty, reallocate(private), iterator.
Inner class Iter that implements interface Iterator having methods: constructor, hasNext, next.
Also add following methods to the ArrayQueue class:
size: returns number of elements in the queue.
contains: Search an element in the queue. If found returns true, else returns false.
clear: Deletes all elements of the queue and make it empty stack.
(C) Write a class called PalindromeChecker having method isPalindrome having a parameter line of type String. The method changes each uppercase letter of line to lowercase, and places each letter of the String line in a queue and also onto a stack. The program should then verify whether the line of text is a palindrome. Include method main to check several Strings, whether each one is a palindrome or not.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Oracle Solaris 11 System Administration

Authors: Bill Calkins

1st Edition

0133007170, 9780133007176

More Books

Students also viewed these Databases questions

Question

What was the role of the team leader? How was he or she selected?

Answered: 1 week ago

Question

How are members held accountable for serving in the assigned roles?

Answered: 1 week ago