Data Structures and Algorithms in Python by Robert Karamagi

Data Structures and Algorithms in Python by Robert Karamagi

Author:Robert Karamagi [Karamagi, Robert]
Language: eng
Format: azw3, epub
Published: 2020-10-17T16:00:00+00:00


Change the parent of x to that of y

Make y as the parent of x .

Assign y as the parent of x.

Right Rotate

In right-rotation, the arrangement of the nodes on the left is transformed into the arrangements on the right node.

Let the initial tree be:

Initial Tree

If x has a right subtree, assign y as the parent of the right subtree of x .

Assign y as the parent of the right subtree of x

If the parent of y is NULL , make x as the root of the tree.

Else if y is the right child of its parent p , make x as the right child of p .

Else assign x as the left child of p .



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.