For C# Implement an efficient sort algorithm (Heapsort). In this assignment you
ID: 3714487 • Letter: F
Question
For C#
Implement an efficient sort algorithm (Heapsort). In this assignment you are asked to create a MaxHeap class capable of holding integer values. The class must expose three public methods: 1. public void Add( int newItem ) 2. public int Remove() 3. public void Show() Respectively, the methods are responsible for (1) insert a new element in the heap, (2) remove the root of the heap, and (3) ‘nicely’ show the contents of the heap. Test your application with the following sample: int[] list = { 2, 9, 5, 4, 8, 1, 6, 7 };
Explanation / Answer
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.