Solutions of Theory of Algorithms assignment 13.2-4

Solutions of Theory of Algorithms assignment 13.2-4 - will...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Solutions of Theory of Algorithms Assignment 6 Exercise 13.2-4 If we have a binary search tree consists of n nodes, and we want to transform it to a right chain binary tree, we will need to make a sequence of right rotations to all the nodes that are on the left side of the tree to bring them to its right. As shown in the previous exercise, we
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: will need at most n-1 right rotations. For example, In generic, to transform binary search tree to another binary tree, it will take at most n-1 rotations. Which means O(n) rotations....
View Full Document

Ask a homework question - tutors are online