Question
in c++ please. thank you!
Page 4 of 4 5. Heap and heapsort: answer the following three questions. a) (1 pt) What is the definition of a max heap? | 0 b
0 0
Add a comment Improve this question Transcribed image text
Answer #1

I a) heap sost: - It is one of the sorting Technique like insertion gost merge sort -- etc & But in the form of Tree *TT 15 pdisin sest 20:- DinSext 10:- DinSest 5.- (10) iv insest 15 :- WinSest 35.- viinsest 30.- VID in Sest 25 - final max heal c) ri am done perfectly anything doubtful or not understand just comment I will touch with you

Please thumbs-up for my effort

Thank you and all the best

Add a comment
Know the answer?
Add Answer to:
in c++ please. thank you! Page 4 of 4 5. Heap and heapsort: answer the following...
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
  • c++ please answer b to e P " b) (2 pts) When we insert an element,...

    c++ please answer b to e P " b) (2 pts) When we insert an element, 5, to the following max heap, what would be the resulting max heap? Give the detailed procedure. 20 c) (2 pts) Based on b), when we remove the root element in the max heap, what would be the resulting max heap? Give the detailed procedure. d) (7 pts) Describe how HeapSort works. Then use the example 20 10 5 15 35 30 25 to...

  • Insert the keys 7, 6, 2, 13, 4, 6, 5, 12 into a min-heap once a...

    Insert the keys 7, 6, 2, 13, 4, 6, 5, 12 into a min-heap once a time, then remove the key in the root repeatedly until the heap is empty. Use diagrams to illustrate each step of the insertion and deletion procedure. What is the time complexity of sorting in this fashion?

  • Using C++, data structures, C++ STL, inputs and expected outputs are shown below. Max Heap Heap...

    Using C++, data structures, C++ STL, inputs and expected outputs are shown below. Max Heap Heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either > (in a max heap) or s (in a min heap) the key of C. The node at the "top" of the heap (with no parents) is called the root node. In binary-tree based heap, it...

  • In C++ In this assignment you will implement a heap data structure that is able to do Heapsort. ...

    in C++ In this assignment you will implement a heap data structure that is able to do Heapsort. Implement it in an array. The first line of input will be given in the form of a list of numbers to insert into a binary tree in level order. Assume it is a complete tree. When finished inserting heapify the tree into a MAXHEAP. Print out the level order traversal for it. Then remove the head (min) and print it out...

  • In class, we discussed the priority queue (PQ) ADT implemented using min-heap. In a min-heap, the...

    In class, we discussed the priority queue (PQ) ADT implemented using min-heap. In a min-heap, the element of the heap with the smallest key is the root of the binary tree. On the other hand, a max-heap has as root the element with the biggest key, and the relationship between the keys of a node and its parent is reversed of that of a min-heap. We also discussed an array-based implementation of heaps. In this assignment, your task is to...

  • Data Structures using C BuildHeap and Heap Sort In preparation: If you have not done so...

    Data Structures using C BuildHeap and Heap Sort In preparation: If you have not done so already, you should complete Worksheet 33 to leam more about the heap data structure. In some applications it is useful to void buildHeap (struct dyArray heap) { initialize a Heap with an existing vector int max = dy Array Size(heap); int i; of values. The values are not assumed for (i = max/2-1; i >= 0; i--) to be organized into a heap, and...

  • PROGRAM DESCRIPTION Using the given class definitions for either C++, create a minimum heap that stores...

    PROGRAM DESCRIPTION Using the given class definitions for either C++, create a minimum heap that stores integers and and implements a minimum priority queue. (Your program can be "hard coded" for integers - it does not need to use templates, generics, or polymorphism.) Your data structure must always store its internal data as a heap. Your toString function should return a string with the heap values as a comma separated list, also including the size of the heap as well....

  • C++ Question 5 5 pts In a min-heap of N elements, if we want to find...

    C++ Question 5 5 pts In a min-heap of N elements, if we want to find the max element, we have to search all the leaves. What is the big-o running time of findMax? O(N^2) Oſlog N) O(N) OIN log N) Question 6 5 pts An AVL tree is a Binary Search Tree that has the following additional property for every node in the tree, the height of the left and right subtrees is the same none of the above...

  • 5. A three-heap with n elements can be stored in an array A, where A[O] contains...

    5. A three-heap with n elements can be stored in an array A, where A[O] contains the root of the tree. a) Draw the three-heap that results from inserting 5, 2, 8, 3, 6, 4, 9, 7, 1 in that order into an initially empty three-heap. You do not need to show the array representation of the heap. You are only required to show the final tree, although if you draw intermediate trees. b) Assuming that elements are placed in...

  • Canvas → XCO Question 4 5 pts When using a hash table with quadratic probing, and...

    Canvas → XCO Question 4 5 pts When using a hash table with quadratic probing, and the table size is prime, then a new element can always be inserted if the table is at least half empty the table is at least half full the table is full the table is larger than any data value Question 5 5 pts The general strategy of inorder traversal is: process the left subtree, then process the current node and finally process the...

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