50 likes | 169 Vues
This coursework focuses on advanced tree data structures. You are required to complete several tasks: first, create five AVL trees using the numbers 1 through 6. Next, determine the number of unique AVL trees that can be formed with the numbers 1 through 4. Additionally, illustrate the insertion of the number 11 into a given AVL tree and explain the rotation process involved. Finally, provide five red-black trees containing the numbers 1 to 6 that do not qualify as AVL trees. Ensure clarity and correctness in your explanations and illustrations.
E N D
CS208 Coursework 3 Individual (not Group) Work! Due Friday 25 May, 12pm
AVL Trees • Question 1: Give 5 AVL trees containing the numbers 1,2,3,4,5 and 6 • Question 2: How many AVL trees are there containing the numbers 1,2,3 and 4
CS203 CW3 Page 2 • Question 3: What is the result of inserting 11 into the AVL tree 6 / \ 4 8 / \ / \ E E E 9 Use the algorithm for inserting data into an AVL tree given in the lectures. Give a clear explanation of why your answer is correct, show the result of the intermediate result of creating a BST and clearly describe any rotations you use.
CS208 CW3 Page 3 • Give 5 trees which are red/black trees but not AVL trees which contain the data 1,2,3,4,5,6