Question: Demonstrate how to use a data structure of type List and one of type Binary Tree - your choice of array or linked list implementation.

Demonstrate how to use a data structure of type List and one of type Binary Tree - your choice of array or linked list implementation. For each Data Type demonstrate using the methods of the ADT class in textbook. Solve 2 out of the following 5: one question from # 4-# 6 and one of # 7 - #8 (your choice): 1. Create a List Ll capable of holding 20 integers and append in order 12, 9,7 then move the fence using next() and insert 2. In the end display the content of the resulting list. 3. Create a stack Si capable of holding 10 elements and which actually stores the following, the top of the stack being the leftmost element: (8, 12, 3, 7,5). Then remove 2 elements and display the Stack. 4. Create a queue Q capable of holding 12 elements. Put the following integers in the queue: 2,4,6,7,5,3. Now take away two numbers and display that Queue. 5. Construct a BST capable of hgolding 32 integers and using succesive insertions from the following list in the given order: { 33, 22, 36, 18, 42, 32, 28, 12, 35, 27, 29,98 }. Insert the value 15 to the above Binary Search Tree. Remove the value 32 from the BST. Write the code for a preorder traversal and display the result. 6. Construct a max-heap that will result from running build Heap on the following values stored in an array: 12 5 9 14 3 11 10 16 8 17. Show the max-heap that results from deleting the maximum value from the max-heap. Write the code for a preorder traversal and display the heap

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!