Provide the terminologies for the following types of trees in the order in which they have been given: A tree in which a consistent format of ordering from each parent node to a child node is followed for the entire tree A tree in which each left child node is less than its parent node and where the right child node is greater than its parent node A tree in which no node has more than two child nodes A tree in which no node has more than two child nodes and where the heights of the two child nodes differ by at most one A heap A binary tree A binary search tree An AVL tree
Added by Heather -.
Step 1
Let's think step by step. Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 52 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Question 21 A binary tree (including subtrees) in which one of its subtrees has a significantly larger height than the other subtree is considered unbalanced. Question 22 Consider the following property: "For every internal position p of a tree T, the heights of the children of p differ by at most 1." This is known as the height-balance property. It is used to characterize a binary search tree in terms of its nodes. Any binary search tree that satisfies the height-balance property is said to be an AVL tree. Question 23 The process of re-establishing heap property is called re-heaping.
Akash M.
QUESTION 3: Construct an AVL tree by using the following data: 14, 17, 11, 7, 53, 4, 13, 12, 8, 60, 19, 16, 20. NOTE: Show insertions and balance factor for every node inserted. Write every new insertion in a different step. QUESTION 4: Show the Red-Black tree after successfully inserting the keys 42, 39, 33, 14, 20, 9. NOTE: Show insertions and specify color for every node inserted. Write every new insertion in a different step. QUESTION 5: i) Which traversal outputs the data in a sorted order in a BST? ii) What is the worst-case time complexity to delete an element from a BST? iii) What is a BST whose leaves are external nodes? iv) Write all the properties of Red-Black Trees. v) What are the advantages of Tree Data Structures? vi) What is the maximum difference in heights between the leaves of an AVL Tree that is possible? vii) Write the pseudocode for double rotation (Right, Left) in an AVL Tree. viii) Write the algorithm for deleting the element (all cases) in a BST. ix) Why do we prefer Red-Black Trees over AVL Trees? x) What is the worst-case time complexity to perform an operation in Red-Black Trees?
Madhur L.
A binary tree is a type of tree data structure in which each node has at most two children, referred to as the left child and the right child. The topmost node of the tree is called the root. Each node in the tree, except for the root, has a parent node. The nodes that have no children are called leaf nodes. A sub-tree is a tree that is formed by selecting a node and all its descendants. The height of a binary tree is the maximum number of edges in the longest path from the root to a leaf node. The depth of a node is the number of edges from the root to that node.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD