I'm trying to write a database program but I need to include ADTs. Would it be possible/efficient to organize the records into a binary search tree with each node/record being a linked list?
Printable View
I'm trying to write a database program but I need to include ADTs. Would it be possible/efficient to organize the records into a binary search tree with each node/record being a linked list?
I don't know how difficult it would be:
write a wrapper class around LinkedList and this class should implement Comparable.
As you are implementing Comparable, you will have to write your compareTo method. You will need to write a comparison algo in this method, which should be able to compare two LinkedLists.
Once you are able to do this, you can easily put this wrapper object in the binary tree.