Results 1 to 1 of 1
  1. #1
    Googol is offline Banned
    Join Date
    Aug 2012
    Posts
    11
    Rep Power
    0

    Default Linked List Class Cons, is this possible to turn into a doubly linked list?

    So I have been trying out a Cons style linked list with only two pointers, one pointing at the first element of the list, and then the second pointing to the entire remainder. Is there a way I could turn this into a doubly linked list? Preferably without changing the current attributes, perhaps just adding more.



    Java Code:
    class Cons
    {
      Object car;
      Cons cdr;
    
      Cons(Oject first, Cons rest)
      {
        car = first;
        cdr = rest;
      }
    }
    Last edited by Googol; 09-25-2012 at 04:26 AM.

Similar Threads

  1. Doubly Linked List removing help?
    By Bungkai in forum New To Java
    Replies: 0
    Last Post: 12-02-2011, 06:58 AM
  2. Doubly-Linked list
    By swp in forum New To Java
    Replies: 3
    Last Post: 10-11-2011, 03:27 PM
  3. Sorted Doubly linked List
    By student2889 in forum New To Java
    Replies: 1
    Last Post: 10-14-2010, 10:05 AM
  4. Doubly Linked List
    By matin1234 in forum New To Java
    Replies: 0
    Last Post: 06-02-2010, 05:58 AM
  5. Help with Doubly linked list
    By Dr Gonzo in forum New To Java
    Replies: 5
    Last Post: 12-06-2008, 07:45 AM

Posting Permissions

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