Thread: Simple linked list to binary tree

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    4

    Simple linked list to binary tree

    Hi. I am now having this problem...
    So, i have a linked list that is ordered by an integer with lots of elements and i want to find the middle of the list that will be the root of the tree.. all fine so far...
    Then i have to do the same with the sublists to find the respective right and left elements. So an exemple of this is can be...

    list->1->2->3->4->5->6->7->...

    4
    / \
    2 6
    / \ / \
    1 3 5 7

    can someone help me with this ?
    Thanks
    Last edited by Ballister; 12-13-2009 at 07:19 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary Tree Search
    By C++Newbie in forum C++ Programming
    Replies: 7
    Last Post: 04-05-2011, 01:17 AM
  2. Reverse function for linked list
    By Brigs76 in forum C++ Programming
    Replies: 1
    Last Post: 10-25-2006, 10:01 AM
  3. Linked List or Binary Search Tree
    By rhysmeister in forum C++ Programming
    Replies: 6
    Last Post: 04-29-2004, 03:04 PM
  4. Linked List
    By jpipitone in forum C Programming
    Replies: 4
    Last Post: 03-30-2003, 09:27 PM
  5. singly linked list
    By clarinetster in forum C Programming
    Replies: 2
    Last Post: 08-26-2001, 10:21 PM