Linked List or Binary Search Tree

This is a discussion on Linked List or Binary Search Tree within the C++ Programming forums, part of the General Programming Boards category; Quick question... I am writing a program to record entries with multiple data entries (4-5). I am just wondering which ...

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    17

    Linked List or Binary Search Tree

    Quick question...

    I am writing a program to record entries with multiple data entries (4-5). I am just wondering which data structure would be best to store this in, a Linked list or a Binary search tree. which would be better?

  2. #2
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Location
    Mt. Prospect, IL
    Posts
    2,572
    Most likely linked list..... how many nodes? static or dynamic?

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    17
    The information grouping will consist of 4/5 data items and any number of individual records. Can you explain why a linked list would be better?

  4. #4
    Obsessed with C chrismiceli's Avatar
    Join Date
    Jan 2003
    Posts
    501
    Originally posted by rhysmeister
    The information grouping will consist of 4/5 data items and any number of individual records. Can you explain why a linked list would be better?
    Elaborate on what you are trying to store? A diagram or something more specific so we can help you.
    Help populate a c/c++ help irc channel
    server: irc://irc.efnet.net
    channel: #c

  5. #5
    Registered User
    Join Date
    Mar 2004
    Posts
    17
    OK the information store should contain...

    1. Title
    2. Author
    3. Reference code
    4. Copy type.

    There would be an an unlimited number of these. This is simply a program to index research papers. Thanks for your thoughts.

  6. #6
    Board Conservative UnregdRegd's Avatar
    Join Date
    Jul 2003
    Posts
    154
    I'd say the binary search tree because you can search through it more efficiently (O(log n) time compared to a linked list's O(n) time).
    I am a programmer. My first duty is to God, then to nation, then to employer, then to family, then to friends, then to computer, and finally to myself. I code with dignity, honor, and integrity.

  7. #7
    Registered User
    Join Date
    Mar 2004
    Posts
    17
    Thanks for your thoughts!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 11-04-2006, 10:07 AM
  2. Binary Tree, couple questions
    By scoobasean in forum C Programming
    Replies: 3
    Last Post: 03-12-2005, 08:09 PM
  3. Tutorial review
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 03-22-2004, 08:40 PM
  4. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM
  5. BST/Red and Black Tree
    By ghettoman in forum C++ Programming
    Replies: 0
    Last Post: 10-24-2001, 10:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21