Question

4. i) Give the difference between binary trees and Binary search trees. Insert the values 50, 76, 21, 4, 32, 64, 15, 52, 14, 100, 2, 3, 70, 87, 80 in the BST [Show the steps]. Write the algorithm for all the 3 operations of BST ii) Insert the given items 16, 14, 10, 8, 7, 9, 3, 2, 4, l into the Min- Heap. [Show the steps]. Write the pseudocode for Insertion of items using the Min- Heap

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
4. i) Give the difference between binary trees and Binary search trees. Insert the values 50,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Binary Search Trees (a) 5 pointsl Insert 5, 12, 7, 1, 6, 3, 13, 2, 10,...

    Binary Search Trees (a) 5 pointsl Insert 5, 12, 7, 1, 6, 3, 13, 2, 10, 11 into an empty binary search tree in the given order. Show the resulting BST after every insertion. (b) 5 points) What are the preorder, inorder, and postorder traversals of the BST you have after (a)? (c) 5 points Delete 2, 7, 5, 6, 11 from the BST you have after (a) in the given order Show the resulting BST after every deletion.

  • Use the Binary Search Tree (BST) insertion algorithm to insert 0078 into the BST below. List...

    Use the Binary Search Tree (BST) insertion algorithm to insert 0078 into the BST below. List the nodes of the resulting tree in pre-order traversal order separated by one blank character. For example, the tree below can be described in the above format as: 75 53 24 57 84 77 76 82 92 0075 0053 0084 0024 0057 0077 OON 0076 0082

  • please I need it urgent thanks algorithms 2 Binary Search Trees- 10 points (5 points each)...

    please I need it urgent thanks algorithms 2 Binary Search Trees- 10 points (5 points each) 1. Write pseudocode for an algorithm that takes in the root of a binary tree and returns whether or not the tree is a legal binary search tree. 2. Write pseudocode for an algorithm that takes in the root of a binary search tree and prints the keys in sorted order.

  • Trees and Heaps 1. Show that the maximum number of nodes in a binary tree of...

    Trees and Heaps 1. Show that the maximum number of nodes in a binary tree of height h is 2h+1 − 1. 2. A full node is a node with two children. Prove that the number of full nodes plus one is equal to the number of leaves in a nonempty binary tree. 3. What is the minimum number of nodes in an AVL tree of height 15? 4. Show the result of inserting 14, 12, 18, 20, 27, 16,...

  • 1. Given the two binary trees below: 14 16 Write a method called swapSubtrees, which swaps all of...

    in java ..write all complete program from a- e 1. Given the two binary trees below: 14 16 Write a method called swapSubtrees, which swaps all of the left and right subtrees in the above binary trees. Add this method to the class BinaryTree and create a program to test this method for these 2 trees. Show the original trees and the resulting trees. Note: To test your algorithm, first create a binary search tree. Write a method called singleParent,...

  • Tree & Hash Table & Heap Use the following integer keys 73, 58, 91, 42, 60, 130, 64, 87 to perform the followings: a) Binary Search Tree - Draw a binary search tree - Retrieve the integers ke...

    Tree & Hash Table & Heap Use the following integer keys 73, 58, 91, 42, 60, 130, 64, 87 to perform the followings: a) Binary Search Tree - Draw a binary search tree - Retrieve the integers keys in post-order - Retrieve the integers keys in pre-order - Draw a binary search tree after node 58 is deleted b) Create a Hash Table using the methods described below. Show the final array after all integer keys are inserted. Assumes that...

  • 3. (8 points) Using the implementation of binary search tree operations we discussed in class, draw...

    3. (8 points) Using the implementation of binary search tree operations we discussed in class, draw the trees that result from the following operations: (a) Inserting 142, 400, 205, 127, 100, 320, 160, 141, and 110 into an initially-empty tree (in that order). (b) Deleting 142 from the tree you drew for part (a). 4. (8 points) Draw the unique binary tree that has a preorder traversal of 4, 1, 6, 3, 7, 5, 9, 2, 8 and an inorder...

  • Database a) Roughly describe how a binary search works. You don’t need to give pseudocode or an e...

    Database a) Roughly describe how a binary search works. You don’t need to give pseudocode or an exact algorithm, but explain the principle or point of how it works. b) In a binary search, does the number of operations required grow roughly exponentially or logarithmically with the number of items to be searched?        c) Can a binary search be done on a “heap” file? Explain why or why not. d) Explain why hashing can (usually) provide very fast lookups (retrieval)...

  • Insert the following values in the given order into a Binary Search Tree and use the...

    Insert the following values in the given order into a Binary Search Tree and use the resulting BST in the next 5 questions. 15 8 3 6 23 9 11 10 20 13 5 9. What is the height of the resulting Binary Search Tree? 10. What is the depth of the node that stores the value 11? 11. Is there a path from the node storing the value 15 to the node storing the value 5? If so, show...

  • I need question 9-10 answered. Thank you Question 1 iShow the resulting binary search tree if...

    I need question 9-10 answered. Thank you Question 1 iShow the resulting binary search tree if we are to insert following elements into the tree in given order, [34, 12, 23, 27,31,9,11,45, 20, 37. i) Show the resulting balanced binary search tree if we are to insert following sorted elements into the tree, [9,12,21, 23, 29, 31, 34, 45, 48, 52, 55] iii What is the pre-order traversal of the balanced binary search tree? v) What is the post-order traversal...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT