Question: vector A = { 5 , 2 1 , 1 9 , 9 5 , 3 1 , 1 2 , 5 3 , 1

vector A ={5,21,19,95,31,12,53,14,25,12,55,57,89,1,23,45,67,89}. i
nsert the elements of A in hash table H of size 10. H is a vector of int is size 10.
Use chaining in case of more than one value.
Draw the table or list the values.
The hash function is the sum of the number 10.; f(n)= n%10; initial values are -1.
4.(1 points) insert the numbers from left to right in the original A in a binary search tree BST. Do not add a new node for a repeated number. Draw the tree showing the nodes and their values.
5.(1 points) Is the tree in (3): Balanced? Full? Complete? Perfect?
6.(1 points) List the nodes of the tree when performing an inorder traversal.
7.(1 points) List the nodes of the tree when performing a preorder traversal.
8.(1 points) List the nodes of the tree when performing a postorder traversal.
9.(1 points) If you have an empty stack STK. Perform the following operations using elements from array A.
STK.push(A[0]); STK.push(A[1]); STK.push(A[2]); STK.pop(); STK.push(A[3]); STK.top(); STK.top(); STK.push(A[4]); STK.push(A[5]); STK.pop(); STK.push(A[6]); STK.top(); STK.top(); STK.push(A[7]);
STK.push(A[8]); STK.pop(); STK.push(A[9]);
List the elements in the stack STK from top to tail.
List the values of the elements in the stack STK from top to tail. Do not put A[i] but values.
10.(1 points) If you have an empty queue QUE. Perform the following operations using elements from array A, where enque is add and deque is delete:
QUE.enque(A[0]); QUE.enque(A[1]); QUE.enque(A[2]); QUE.deque(); QUE.enque(A[3]); QUE.enque(A[4]); QUE.enque(A[5]); QUE.deque(); QUE.enque(A[6]); QUE.enque(A[7]); QUE.enque(A[8]); QUE.deque(); QUE.enque(A[9]);
List the values of the elements in the queue QUE from head to tail. Do not put A[i] but values.
In this question, do not use (A). Use the segments listed instead.
11.(5 points) There is a directed graph with 8 vertices and the following directed edges (u, v) means (u -> v):
(a, b)
(a, e)
(b, c)
(c, d)
(c, e)
(d, h)
(e, d)
(f, e)
(f, g)
(g, h)
(h, f)
In these three questions, you can draw or use: a: b, c notation instead of drawing.
11.1: (1 points) Draw (or write) the graph
11.2: (1 points) Draw (or write) the adjacency matrix
11.3: (1 points) Draw (or write) the adjacency list
11.4: (1 points) DFS trace of the vertices from (a)(vertices)11.5: (1 points) BFS trace of the vertices from (a)(vertices)
ChatGPT
4

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!