Question
Use what you learned in problem 6 above to create a recursive function called integerToString() that returns a String representation of an integer n expressed
Use what you learned in problem 6 above to create a recursive function called integerToString() that returns a String representation of an integer n expressed in base b. For instance the function call integerToString(100,8) would return the String 144, which is what was printed in problem 6. static String integerToString(int n, int b){ // your code starts here // your code ends here } 8. Recall the IntegerList ADT discussed in class whose states were the finite integer sequences, and whose operations were isEmpty(), size(), get(), add(), remove(), and removeAll(). Write the methods described below using only these six ADT operations. In other words you are writing methods belonging to a client of IntegerList. a. Write a static void method called swap(IntegerList L, int i, int j) that will interchange the items currently at positions i and j of the List. b. Write a static int method called search(IntegerList L, int x) that will perform a linear search of L for the target x. search() will return the List index where x was found, or it will return 0 if no such index exists. (Recall List indices range from 1 to size().) c. Write a static void method called reverse(IntegerList L) that reverses the order of the items in L
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started