1. Engineering
  2. Computer Science
  3. can you please answer these 4 questions thank you very...

Question: can you please answer these 4 questions thank you very...

Question details

Can you please answer these 4 questions Thank you very much JAVA:

  1. If myList is a declared ADT list and the front of the list is on the left, show the contents of the list after applying the following pseudo code?

    myList.add(“horse”)   myList.add(“goat”) myList.add(1, “fish”) myList.add(“cat”) myList.remove(1) myList.add(2, “dog”)

  2. If myList is a declared ADT list and the front of the list is on the left, show the contents of the list after applying the following pseudo code?

    myList.add(“horse”) myList.add(“goat”) myList.add(1, “fish”) myList.add(“cat”) myList.remove(2) myList.add(3, “dog”) myList.replace(2, “frog”)

  3. Given treeList is a declared ADT list that is initially empty, write a serious of list operations to generate the following list step by step.

    a. maple
    b. maple, oak
    c. maple, elm, oak d. palm, elm, oak

  4. Given treeList is a declared ADT list that is initially empty, write a serious of list operations to generate the following list step by step.

    1. maple

    2. oak, maple

    3. oak, elm, maple

    4. elm, maple

to use Ginger
Limited mode
MyList. remove (1) myList. add (2
×
to use Ginger
Limited mode
Maple
×
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution