## case 1. After insert.(New Node uncle is red).

1.Change the color of grandparent of new node.
2.Change the color of parent and uncle of new node.

~ New node unle is black and New node is right child of the parent.

1. Anti-clock wise Rotation of the grandparent of the new node.
~ New Node uncle is black and new node is left child of it's parent .

1.Clockwise rotation of the grandparent of new node.
2. Exchange color of the grandparent and parent of new node.

## SORTING

`Sorting is a process to arranged the data in some type of order.`
`This is order may increasing, decreasing and numerical value or dictionary`
`in case of alphanumerical values.`
```Bubble Sort.
Bubble sort is very simple and easy to implement the sorting technique```
```Algorithm
Bubblesort(a,n)```
```

Here a is  a linear array of n element

Step

1. Repeat step 2 and 3 for i= 1 to n-1.

2. Set j=1 [ Intilize counter ].

3. Repeat Step While(j>n-1)

```
`     \$). if a[i] > a[i+1] then `
`         interchange  a[i] and  a[i+1]`
`         End if structure. `
`     \$). j= j+1.`
`    End of inner loop.`
` End of step 1 outer loop.`
` 4.Exit`
```
Program to write the Bubble sort..

def bubbleSort(a):
n = len(a)
for i in range(n):
for j in range(0, n - i - 1):
if a[j] > a[j + 1]:
temp=a[j]
a[j] = a[j+1]
a[j+1]=temp
# Or we can a[j], a[j + 1] = a[j + 1], a[j]
# before sorted array.
a = [4, 3, 5, 1, 2, 11, 20,45,22,63]
# function for bubble sort.
bubbleSort(a)
print("After Sorted array is:")
# b indicate the size of the array.
b = len(a)
for i in range(b):
print(a[i],end=" ")```

## Red black tree (Introduction)

### Arrays in Solidity Programming Language.

Arrays Solidity supports both generic and byte arrays. It supports both fixed size and dynamic arrays. It also supports multidimensional ...