CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2010
    Posts
    1

    Question Union of Intervals - Advanced Data Structures

    I need help understanding Union of Intervals based on Advanced Data Structures Book by Peter Brass. Attached is the section of the book that Im trying to Understand starting from the middle of the page 163 where it says "A fully dynamic structure to maintain the measure of a union of intervals..." I also attached my code (in C)

    Im trying to make the Measure of all Unions of Intervals Calculate Properly.

    This is basically what I understood,
    1) Start with any Balanced Search Tree. Therefore I used height balanced search tree.
    example, for interval [1,9], I insert a 1 into the tree. Then I Insert a 9 into the tree.

    2) during insertion of for interval [1,9]
    a) i record the path of 1 into a stack, insert 1 into the tree, rebalance the tree, use the stack to trace back to the root while calculating the leftmin, rightmax and measure.

    -b) record the path of 9 into a stack, insert 1 into the tree, rebalance the tree, use the stack to trace back to the root while calculating the leftmin, rightmax and measure.

    What's messing me up is it's associated nodes. I can't visualize it correctly.
    Anyway, I implemented this in C and its not calculating right. Am I missing something?

    I also asked my professor about this but I also want to know other's perspective about this.

    Thanks in Advance
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2011
    Posts
    1

    Re: Union of Intervals - Advanced Data Structures

    hi ,
    i too faced the same problem..do u got any solutions for that..if so plzz place that extension

Tags for this Thread

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured