In: Computer Science
Want to double check the work I did for these questions to make sure they were done right:
0 1 0 0 0
1 0 0 0 1
1 0 0 1 0
0 0 1 0 1
0 0 0 0 0
draw the adjacency List
A) Build a BST using the following numbers: 16,12,56,7,19,2,9 Build the tree in the order in which the numbers appear.
Steps are as follows
1) insert 16
2) insert 12
3) insert 56
4) Insert 7
5) Insert 19
6) Insert 2
7) Insert 9
Here is the final Binary Search Tree:
B) Using 16,12,56,7,19,2,9, build an AVL balanced binary tree
Steps are as follows
1) Insert 16
2) Insert 12
3) Insert 56
4) Insert 7
5) Insert 19
6) Insert 2
7) Insert 9
here is the final AVL Tree
C) Using 16,12,56,7,19,2,9 and assuming they are stored in an array, show the array after the third pass of the selection sort
Initially
after 1st pass:
after 2nd pass:
after 3rd pass:
D) Using 16,12,56,7,19,2,9 and assuming they are stored in an array, show the array after the third pass of the insertion sort
Initially :
after 1st pass:
after 2nd pass:
after 3rd pass:
E) Given the following adjacency matrix:
0 1 0 0 0
1 0 0 0 1
1 0 0 1 0
0 0 1 0 1
0 0 0 0 0
draw the adjacency List
a) Adjacency Matrix
b) Graph
c) Adjacency List
d) Edge List
*** If you have any doubts regarding the solution, please do ask in comments ***