Results 1 to 2 of 2
  1. #1
    Bmorebob is offline Member
    Join Date
    Mar 2011
    Location
    Manassas, VA
    Posts
    14
    Rep Power
    0

    Default Binary Tree of Linked Lists

    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?

  2. #2
    lovelesh is offline Senior Member
    Join Date
    Nov 2010
    Location
    Delhi
    Posts
    135
    Blog Entries
    1
    Rep Power
    0

    Smile

    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.

Similar Threads

  1. concatenating linked lists
    By coder94 in forum New To Java
    Replies: 1
    Last Post: 02-28-2011, 06:16 AM
  2. Linked Lists
    By Dee in forum New To Java
    Replies: 18
    Last Post: 02-02-2011, 03:14 AM
  3. Concatenate Linked Lists
    By tttestall in forum New To Java
    Replies: 1
    Last Post: 04-20-2010, 07:03 PM
  4. Replies: 0
    Last Post: 04-04-2010, 07:40 AM
  5. Linked Lists
    By vendetta in forum New To Java
    Replies: 6
    Last Post: 01-26-2010, 08:23 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •