Parallel structures

This is a discussion on Parallel structures within the C++ Programming forums, part of the General Programming Boards category; I have a binary search tree class and i need to write functions to peform on a binary search tree ...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    25

    Parallel structures

    I have a binary search tree class and i need to write functions to peform on a binary search tree such as are two trees similar in structure, what is the height of Tree A, is Tree A perfect and the list goes on. I have figured that I need a list of trees in which trees is another class that has data members

    name: to give the tree a specific name (this implementation is a binary search tree of integers) and bst: the tree associated with the name.

    Can someone clarify that this is not a parallel structure.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,590
    Seems to me like you implement the tree class as a template, then you instantiate that template with the data class(es) of your choice.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 07-11-2008, 07:39 AM
  2. Serial to Parallel
    By ssharish2005 in forum Tech Board
    Replies: 11
    Last Post: 09-10-2007, 01:11 PM
  3. Segmentation Fault - Trying to access parallel port
    By tvsinesperanto in forum C Programming
    Replies: 3
    Last Post: 05-24-2006, 03:28 AM
  4. Classes and Structures.
    By jrahhali in forum C++ Programming
    Replies: 6
    Last Post: 03-28-2004, 04:03 PM
  5. Methods for Sorting Structures by Element...
    By Sebastiani in forum C Programming
    Replies: 9
    Last Post: 09-14-2001, 12:59 PM

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