File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
Joined: May 13, 2010
May 14, 2010 05:29:42
Can anyone explain me the Heap sort logic and how to implement it in
And suggest me which sort algorithm is the best in performance wise with huge Data and less Data?
Joined: Oct 27, 2005
May 14, 2010 05:40:25
. There is an example there in Pascal / Delphi. Let's see if you can read that. For your information, ":=" is the assignment operator in Pascal / Delphi.
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions
How To Answer Questions
Joined: Oct 02, 2003
May 14, 2010 06:38:12
the Heap data structure is basically a tree, where the child nodes are always smaller (by whatever definition of 'smaller' you choose) than the parent.
There are algorithms for re-heapifying a heap once you remove an element.
A Heap sort builds a heap out of your data.
you remove the largest node (which is by definition the root of the heap), and stick it at the end of your array, then re-heapify what's left.
You then remove the largest node, put it in the second to last spot, and re-heapify.
Never ascribe to malice that which can be adequately explained by stupidity.
Joined: Jan 20, 2010
May 14, 2010 07:12:44
Heap is a complete binary tree.
A small leak can sink a Gigantic ship.>
I agree. Here's the link:
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Heap sort.
Heap Sort and Quick Sort
Data Structures in java : Examples
Priority Queue and iterator
Mystic with PriorityQueue
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013