Results 1 to 14 of 14
  1. #1
    someone is offline Member
    Join Date
    Apr 2011
    Posts
    18
    Rep Power
    0

    Default help me on this: circular doubly linked list

    You have to write a program to support the following operations regarding a circular doubly linked list with sentinels



    a. Create empty list
    b. Insert a key into the list
    c. Search a key in the list
    d. Delete a key form the list (Hint: search first and delete if found)
    e. Display all the keys in the list
    f. Destroy the list (Hint: use multiple deletes)
    Last edited by someone; 04-11-2011 at 09:49 AM.

  2. #2
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    What do you want help on? No one is going to write it for you. So ask a question and recieve an answer or type of some code and post a problem you discovered with code.

    Other than that, we can't help you.

  3. #3
    someone is offline Member
    Join Date
    Apr 2011
    Posts
    18
    Rep Power
    0

    Default

    yes I know I want to know where should I start. I mean I got trouble with start creating the list. if any one have idea just tell me

    Thanks Dark

  4. #4
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    Normally I start off my programs with this:
    Java Code:
    public class myProgram
    {
        public static void main(Strings[] args)
        {
        }
    }
    That's what I do. Any other questions?

  5. #5
    someone is offline Member
    Join Date
    Apr 2011
    Posts
    18
    Rep Power
    0

    Default

    my question was regard the linked list it self
    how can I start creating an empty list.

  6. #6
    dswastik is offline Senior Member
    Join Date
    Dec 2008
    Location
    Kolkata
    Posts
    282
    Rep Power
    6

    Default

    Using java apis or using your own class?
    Swastik

  7. #7
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by someone View Post
    my question was regard the linked list it self
    how can I start creating an empty list.

    can you explain what data structure inside the linked list is planned?

  8. #8
    someone is offline Member
    Join Date
    Apr 2011
    Posts
    18
    Rep Power
    0

    Default

    how to create empty list with linked list !

  9. #9
    dswastik is offline Senior Member
    Join Date
    Dec 2008
    Location
    Kolkata
    Posts
    282
    Rep Power
    6

    Default

    Have you gone through the api docs?

    List<String> al=new LinkedList<String>();
    Swastik

  10. #10
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    *Sigh* j2me64 just asked you what type of information are you trying to store in this list?

    Strings? Integers? Doubles? Booleans?

  11. #11
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by someone View Post
    how to create empty list with linked list !

    yes, but in order to create an empty linked list you must first specify which attributes and methods the class should have and then inside the constructor you can initialize your linked list.

  12. #12
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,733
    Blog Entries
    7
    Rep Power
    21

    Default

    @OP: please don't double post.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  13. #13
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by Dark View Post
    *Sigh* j2me64 just asked you what type of information are you trying to store in this list?

    Strings? Integers? Doubles? Booleans?

    not exactly. it would be great if the planned linked list could store any type of objects. with my question i want to know what kind of nodes and other data structures the list should contain.

  14. #14
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    True but I still don't think he understands that. I was trying to give him examples to base what he wanted in there. I doubt with his knowledge the program will be calling for a very extensive list.

Similar Threads

  1. help me with this ! circular doubly linked list
    By someone in forum Advanced Java
    Replies: 1
    Last Post: 04-11-2011, 11:35 AM
  2. Replies: 5
    Last Post: 02-04-2011, 05:29 AM
  3. Doubly Linked List
    By matin1234 in forum New To Java
    Replies: 0
    Last Post: 06-02-2010, 06:58 AM
  4. Circular Double Linked List
    By theonly in forum Advanced Java
    Replies: 3
    Last Post: 12-06-2009, 06:10 PM
  5. Help with Doubly linked list
    By Dr Gonzo in forum New To Java
    Replies: 5
    Last Post: 12-06-2008, 08: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
  •