Help: One Question for each: Linked List and Tree

This is a discussion on Help: One Question for each: Linked List and Tree within the C++ Programming forums, part of the General Programming Boards category; 1. This is about linked list. I know how to dump the elements of a linked list to the screen ...

  1. #1
    Yin
    Guest

    Question Help: One Question for each: Linked List and Tree

    1. This is about linked list.

    I know how to dump the elements of a linked list to the screen in a First-In-Last-Out manner.

    However, how can I do it in a First-In-First-Out manner?

    Should I change the way of adding element (i.e. by adding elements at the tail of list rather than the front of the list)?

    Or should I change the way of dumping elements to the screen?

    2. This is about tree. I know how to dump the elements of a tree in "alphabetical manner".

    However, how can do it in a First-In-First-Out manner?

    Should I change the way of adding elements (which seems to violate the priciple of making a tree)?

    Or should I change the way of dumping elements to the screen?

    3. Is there any other methods (or other types of dynamic data structure) which serve the above purposes with higher efficiency?

  2. #2
    Nor
    Nor is offline
    h ֆhr s Nor's Avatar
    Join Date
    Nov 2001
    Posts
    299
    First in First out. Look into .Stacks
    Try to help all less knowledgeable than yourself, within
    the limits provided by time, complexity and tolerance.
    - Nor

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  2. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  3. How can I traverse a huffman tree
    By carrja99 in forum C++ Programming
    Replies: 3
    Last Post: 04-28-2003, 05:46 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. Array, Linked List, or Binary Tree?
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 01-05-2002, 09:07 PM

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