For Programmers: Free Programming Magazines  


Home > Archive > Java Help > March 2008 > Remove in Heap









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Remove in Heap
Andrew Marcus

2008-03-24, 7:35 pm

I have implemented a heap using Vector class.But I couldnot implement
the removeMin() function to remove the smallest element.Can anyone
help??
Kenneth P. Turvey

2008-03-24, 7:35 pm

On Mon, 24 Mar 2008 12:25:18 -0700, Andrew Marcus wrote:

> I have implemented a heap using Vector class.But I couldnot implement
> the removeMin() function to remove the smallest element.Can anyone
> help??


Why don't you post the code?



--
Kenneth P. Turvey <kt-usenet@squeakydolphin.com>
Lew

2008-03-24, 10:33 pm

Andrew Marcus wrote:

Kenneth P. Turvey wrote:[color=darkred]
> Why don't you post the code?


That's a good suggestion for the OP, as is to cease multi-posting.

java.util.Vector is an archaic class, supplanted in 1998 by
java.util.ArrayList and the Collections.synchronizedList() version of it if
synchronization is needed.

Also, the API class java.util.PriorityQueue
<http://java.sun.com/javase/6/docs/a...orityQueue.html>
implements a heap.

--
Lew
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com