Thread: Splitting BST General

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    12

    Splitting BST General

    Happy thanksgiving everyone,

    I'm trying to get a general idea of how to split a single binary search tree into two seperate tree. I was curious is there a general form or procedure to do this? Thank you for your time.

    Procedure: P* is a pointer to BST, nd x is the value that may or may not be in the BST. I need to split P into two BST q and r so that q contails all the vaues in p that are less than x, and r contains all the values in p that are great than x.
    Last edited by cpp_is_fun; 11-24-2005 at 11:57 AM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    How about Prelude's corner in the FAQ - lots of BST stuff there.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BST array
    By Iron_Shortage in forum C Programming
    Replies: 5
    Last Post: 04-20-2009, 03:04 PM
  2. bst in postorder to file algorithm?
    By iunah in forum C Programming
    Replies: 2
    Last Post: 02-01-2009, 06:13 AM
  3. problem inserting into recursive BST
    By nfrandsen in forum C Programming
    Replies: 4
    Last Post: 09-13-2008, 07:03 PM
  4. General Guidelines on Preventing Header File collision
    By stanlvw in forum C++ Programming
    Replies: 12
    Last Post: 07-05-2008, 04:02 AM
  5. I would love some input on my BST tree.
    By StevenGarcia in forum C++ Programming
    Replies: 4
    Last Post: 01-15-2007, 01:22 AM