Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please slove all question sir.... take time using C++ Program Binary Heap 1. Write a program to find k largest element in an array. You

image text in transcribed

Please slove all question sir....

take time

using C++ Program

Binary Heap 1. Write a program to find k largest element in an array. You have use binary heap to solve the above mentioned problem Sample Input 1,23, 12, 9, 30, 2, 50 Sample Output K:3 Element: 50, 30,23 2. Write a program to sort elements of an array in ascending order using Binary Heap. Sample Input 12, 11, 13, 5, 6, 7 Sample Output 5 6 7 11 12 13 3. Write a program to convert an array representing Min Heap to Max Heap. Sample Input 35 9 6 8 20 10 12 18 9 Sample Output 20 18 10 12 9 935 6 8 or (any Max Heap formed from input elements] 4. Write a program to find smallest and largest element of a binary heap. Sample Input Sample Output 35 9 6 8 20 10 12 18 9 Min: 3 Max: 20

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions