Thread: Question on algorithm

  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
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    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
    Chappell Hill, Texas
    Posts
    2,332
    Mainframe assembler programmer by trade. C coder when I can.

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, 09:22 PM
  5. More a math question than an algorithm
    By Gustaff in forum C Programming
    Replies: 1
    Last Post: 01-28-2003, 01:10 PM