Question on algorithm

This is a discussion on Question on algorithm within the C++ Programming forums, part of the General Programming Boards category; I need to write a program that uses a binary search tree, and linear linked list, but I can only ...

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    22

    Question on algorithm

    I need to write a program that uses a binary search tree, and linear linked list, but I can only use 1 struct, are there any tutorials about how to do either one without using a structure?

  2. #2
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,243
    Quote Originally Posted by Brimak86 View Post
    I need to write a program that uses a binary search tree, and linear linked list, but I can only use 1 struct, are there any tutorials about how to do either one without using a structure?
    You can use the same struct for both. The tree has a "left" and a "right." The list has a "next." So just use "right" to mean "next" for the list, and pretend that "left" doesn't exist.

  3. #3
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Katy, Texas
    Posts
    2,309
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Quick Algorithm Question
    By cjwenigma in forum C++ Programming
    Replies: 3
    Last Post: 11-01-2007, 10:39 AM
  2. Design layer question
    By mdoland in forum C# Programming
    Replies: 0
    Last Post: 10-19-2007, 04:22 AM
  3. STL algorithm question
    By Reggie in forum C++ Programming
    Replies: 1
    Last Post: 04-22-2003, 09:04 AM
  4. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 08:22 PM
  5. More a math question than an algorithm
    By Gustaff in forum C Programming
    Replies: 1
    Last Post: 01-28-2003, 12:10 PM

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