Results 1 to 2 of 2
  1. #1
    Jumanji245 is offline Member
    Join Date
    May 2011
    Rep Power

    Default I need help with this problem ASAP, Java Balanacing Tree !!!!!

    (14pts) Below is the diagram to rebalance an AVL tree when the AVL condition is violated at the node P because of an insertion to the right of P's left child.

    Complete the method doubleWithLeftChild(Node p) below that (1) rebalances the tree at P, (2) adjusts the heights of nodes whose children have changed, and (3) returns a reference to the new root node R of the rebalanced subtree.

    PictureTrail: Online Photo Sharing, Social Network, Image Hosting, Online Photo Albums

    Node doubleWithLeftChild(Node p)


    where the Node structure is private class Node
    public E data;
    public Node left;
    public Node right;
    public int height;

    public Node() { height = -1; }
    public Node(E d) { data = d; height = 0; }

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power

Similar Threads

  1. Need help ASAP! Problem due tomorrow!
    By ProtoMan in forum New To Java
    Replies: 19
    Last Post: 02-22-2011, 06:00 AM
  2. Replies: 0
    Last Post: 07-19-2010, 11:25 PM
  3. Replies: 0
    Last Post: 04-04-2010, 08:40 AM
  4. problems with java code! (very new - need help asap!)
    By sumkindafreek in forum New To Java
    Replies: 1
    Last Post: 01-07-2009, 06:00 AM
  5. Need Java Help ASAP
    By L-dog in forum New To Java
    Replies: 22
    Last Post: 10-03-2008, 12:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts