gwtw / js-binomial-heap

A JavaScript implementation of the binomial heap data structure
MIT License
6 stars 0 forks source link

Implement decreaseKey operation #6

Open Tyriar opened 8 years ago

nathanandersen commented 8 years ago

Is this going to be done soon? I'd like to use your implementation but this is a very important gap.

Tyriar commented 8 years ago

@nathanandersen I've recently been going through my data structures improving them, since you're interested in this I'll try get to this in the next few weeks.

I'd recommend using the Fibonacci heap though which is pretty much better in every way and implements all the operations https://github.com/gwtw/js-fibonacci-heap

williscool commented 7 years ago

@Tyriar @nathanandersen

I've written a version with decreaseKey and delete if you're looking for inspiration

https://github.com/williscool/code_gym/blob/master/javascript/data_structures/heap/binomial_heap.js

and test

https://github.com/williscool/code_gym/blob/master/javascript/test/data_structures/binomial_heap_test.js

I 've even used it to build a prority queue and run djikstra's algorithm

Your implementation helped me get mine done when I was working on it for fun a while ago :)

working on porting my code base to es6 right now also on the es6ify branch.

Tyriar commented 7 years ago

@williscool cool 😃, glad I helped!

williscool commented 7 years ago

Also just went through and documented the hell out of this thing

https://github.com/williscool/code_gym/blob/5919e70751a5b4a54fde5f505123f3fcfd73af12/javascript/data_structures/heap/binomial_heap.js