3

what is the difference between WAVL (weak AVL) and Red Black Tree? is there a specific reason to use WAVL over RB?

nadavs
  • 57
  • 6
  • Hi, Welcome to Stack Overflow. Be aware that answers to this question may result in answers that are not entirely based on facts, or answers that are biased due to personal preference. Possibly there are different usage cases where each option about would be better to serve a given purpose. To receive an answer about that consider adding some more detail to the question noting how you want to use this and why you feel each option either does, or does not, fulfil your need. I hope you are able to find out which option is right for you :) – William Patton Mar 27 '17 at 13:44

1 Answers1

2

A WAVL tree is an attempt to combine the best characteristics of a AVL trees and red-black trees. Just inserting into a WAVL tree will build the same tree as an AVL tree - one that is more strictly balanced than a red-black tree so WAVL trees can be expected to perform better in situations where red-black trees become more unbalanced. Delete in WAVL is slightly simpler than delete for AVL trees in that WAVL deletes perform only 1 or 2 rotations and stop instead of potentially all the way to the root.

David McManamon
  • 385
  • 2
  • 10
  • 1
    That is simple to say but there is nothing that explain the WAVL on the web for which can help us validate the truth about their algorithm. – Eric Ouellet Mar 06 '18 at 18:28
  • I think we can find all the information you need on the web regarding WAVL trees. What truth do you want to validate? The original paper about them covers all the details and the performance is similar to AVL trees which are covered in Ben Pfaff's 2004 paper (AVL 20% faster than red-black). – David McManamon Mar 08 '18 at 02:50
  • Thanks. I would have liked to read the original paper which explain in details all the rules. Also you refer to AVL 20% faster than Red Black Tree. It souds weird to me because there is many variables that could affect performance like using recursion or iteration, the way you generate new node (from a bank or not), what you do: read vs insert vs delete and when. Do both implementation shared same optimizations. I twould be nice to include reference (link) in your answer if you have any. The seems to be not accessible??? – Eric Ouellet Mar 08 '18 at 05:09
  • The paper describing WAVL trees is titled "Rank Balanced Trees" it is here: http://sidsen.azurewebsites.net// Ben Pfaff's paper is here: https://benpfaff.org/papers/libavl.pdf – David McManamon Mar 08 '18 at 15:30