From: Jon Aseltine Date: 2001-02-11T12:24:28+09:00 Subject: [ruby-talk:10696] Re: heap data structure Michael Davis wrote: > > Can I make the heap a static or fixed size? For example, I want the heap to be 2K regardless of how many items it contains. > > Can I marshal dump and load heaps? > > I think this may be just want I need to create a btree for ruby. No, I don't think there is an easy way to make a heap do these things. Heaps grow dynamically as new keys are inserted -- there is no way around this. Why don't you just write a B-tree class? Chapter 19 of "Introduction to Algorithms" by Cormen, Leiserson, and Rivest should give you enough of a background (and pseudocode) to write a nice Ruby class. Jon -- _______________________________________________________________________ Jonathan Aseltine aseltine@cs.umass.edu MAS, Umass, Amherst