6.
After applying RL rotation the diagram will be:
First we apply LL rotation at w, then apply RR rotation on resulting tree at r.
It's clear that the final tree is also a BST:
as all elements of T1 are smaller than r and all elements of T2 are larger than r.
as all elements of T3 are smaller than w and all elements of T3 are larger than w.
And all r is smaller than v and w is larger than v.
6. Draw a diagram of the double RL-rotation in its general form. A partial solution is...
1. Let A = {a1, ..., an} and B = {b1, ..., bm} be two sets of numbers. Consider the problem of finding their intersection, i.e., the set C of all the numbers that are in both A and B. a. Design a presorting based algorithm for solving this problem and determine its efficiency class. 2. Estimate how many searches will be needed to justify time spent on presorting an array of 103 elements if sorting is done by mergesort...
Programming Language: JAVA Construct a program that uses an agent to solve a Sudoku puzzle as a Constraint Satisfaction Problem, with the following guidelines: 1. Since 3 x 3 puzzles are too trivial for a computer, your program should use 4 x 4 puzzles (also known as Super Sudoku puzzles; see Figure 2 for an example). 2. The program should read a Sudoku puzzle from a text file. The user should be able to browse the file system to select...