So a binary heap can be implemented as follows:
For any index i...
parent of i = floor(i/2)
left child of i = 2i
right child of i = 2i+1
But what about for non-binary heaps? Say, a 5-heap....
Type: Posts; User: TBBucs
So a binary heap can be implemented as follows:
For any index i...
parent of i = floor(i/2)
left child of i = 2i
right child of i = 2i+1
But what about for non-binary heaps? Say, a 5-heap....
Ok, so here are my classes and interfaces:
public interface I_LinkedStack<T> extends Iterable<T>
public LinkedStack implements I_LinkedStack
-- private static class Node<T>
-- private class...