Besonderhede van voorbeeld: 1980758869149843317

Metadata

Author: WikiMatrix

Data

English[en]
Implementation of balance-preserving insertion and deletion is simplified by relying on the skew and split operations to modify the tree only if needed, instead of making their callers decide whether to skew or split. function skew is input: T, a node representing an AA tree that needs to be rebalanced. output: Another node representing the rebalanced AA tree. if nil(T) then return Nil else if nil(left(T)) then return T else if level(left(T)) == level(T) then Swap the pointers of horizontal left links.
Persian[fa]
پیادهسازی «متعادل نگه داشتن» درج کردن و حذف کردن، توسط عملگرهای مورب (skew) و شکاف (split) سادهسازی شده است، تا فقط در صورت نیاز اصلاح درخت صورت گیرد، به جای اینکه صدا زنندههای آن انتخاب کنند که مورب صورت بگیرد یا شکاف. '''function''' skew '''is''' '''input:''' T, a node representing an AA tree that needs to be rebalanced. '''output:''' Another node representing the rebalanced AA tree. '''if''' nil(T) '''then''' '''return''' Nil '''else if''' nil(left(T)) '''then''' '''return''' T '''else if''' level(left(T)) == level(T) '''then''' ''Swap the pointers of horizontal left links. ''

History

Your action: