Data Structure Midterm Lab Project
Data Structure Midterm Lab Project
- Class ArrayChar that have as private attribute (char[] arr, int size) and it can
apply
all the methods of ArrayList depending on basic array implementation and
algorithm -- ArrayChar can be resizable at any size (similar to be ArrayList but it
is
not).
- Class Stack that can apply all the methods of stack (the implementation is based
on ArrayChar) where the top of stack is the beginning of ArrayChar
- Method searchFor that can accept also a char or a String you asked for and return
an ArrayList contains the count of each char exists in stack
- Menu that accepts the input from scanner and output the result based on your
choice
- Class main to instance ArrayChar and Stack and apply the code of the menu
NB: The Following sample run explain how program work (read it carefully). And it
should be repeated until you choose to exit.
. Insert in Beginning
. Insert in end
. pop
9. Length
10. Reverse
11.Display
CW ~1 on Ud wh
Sample Run: Execution example
Good Bye
Exercise 2: