Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: About heap data type

  1. #1
    Junior Member
    Join Date
    May 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default About heap data type

    Hey guys,
    I am confused with complete binary search tree and heap data type. Are they the same?

    Many Thanks

    Paddy


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: About heap data type

    No, Binary search trees gaurentee that the left node > the node > the right node, while heaps guarantee that the main node > either child, but in no particular order. Also, heaps mix in indexing, too and enforce that the depth can only increase when the last depth was completely filled, while binary search trees can have any depth changes made dispite the current row being partially filled (of course, self balancing binary trees try to remedy this, but still does not fulfill the same roll as heaps).

    Each type of data structure has different performance times, a quick peek over at wikipedia can give you the big-O notation for common operations with each data structure.

  3. #3
    Junior Member
    Join Date
    May 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Re: About heap data type

    ah I see.Thanks a lot.

Similar Threads

  1. Implementing a 5-heap with an array
    By TBBucs in forum Algorithms & Recursion
    Replies: 0
    Last Post: April 12th, 2010, 10:56 PM
  2. Replies: 15
    Last Post: February 28th, 2010, 09:30 PM
  3. Java heap space error
    By Loki in forum What's Wrong With My Code?
    Replies: 3
    Last Post: January 27th, 2010, 09:47 PM
  4. Selection Sorting of Data type (Char)
    By chronoz13 in forum Algorithms & Recursion
    Replies: 1
    Last Post: December 20th, 2009, 07:28 PM
  5. OutOfMemoryError (Java heap space)
    By chronoz13 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 21st, 2009, 10:56 AM