1. Implement a class StackADT.java - a stack that holds characters - i.e. 'a', 'b', 'O', etc. You may use either the arr

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

1. Implement a class StackADT.java - a stack that holds characters - i.e. 'a', 'b', 'O', etc. You may use either the arr

Post by answerhappygod »

1 Implement A Class Stackadt Java A Stack That Holds Characters I E A B O Etc You May Use Either The Arr 1
1 Implement A Class Stackadt Java A Stack That Holds Characters I E A B O Etc You May Use Either The Arr 1 (159.38 KiB) Viewed 51 times
1. Implement a class StackADT.java - a stack that holds characters - i.e. 'a', 'b', 'O', etc. You may use either the array or the linked implementation. Your StackADT.java class should implement the following methods: a. void push (char c); b. char pop(); C. char peek(); d. boolean isEmpty(); 2. Implement a class StringUtilities.java. This class should have a method reverseString, that uses the StackADT.java class in order to reverse a given string and return it. This class should have 2 methods: a. static String reverseString(String str); i. method should use StackADT to reverse a given string. ii. static so that you can simply call it from main using StringUtilities.reverse(...) iii. Example: To reverse the string "hello", you would call: StringUtilities.reverse ("hello"). This should return "olleh". b. static void main(String[] args); i. A main method for you to run test cases for your reverse String method. ii. Example: System.out.println ("Expect: olleh. Got: StringUtilities.reverse ("hello") 3. Deliverable: a. Turn in 2.java files StackADT.java and StringUtilities.java IT +
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply