Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
The number of black nodes on any path from a particular node x to a leaf
node is called the black height of that node; bh(x). Property 6 defines the
constraint on black-height of a node. We define the black height of the
tree to be the black height of the root.
Insertion Example
Red Black Tree Traversal
This method involves visiting all the nodes at each level from left to right
before moving on to the next level. It requires the addition of a next
pointer in the definition of the node which points to next node in the
same level. If it is the last node in a given level, then it points to the first
node of the next level. For example, the result of traversing the Red-Black
Tree shown in Figure 1 using the next pointers is as follows: 30, 15, 70, 10,
20, 60, 85, 50
Linear Congruential Generator
A Linear Congruential generator is an algorithm that yields a sequence of
randomized numbers calculated with a discontinuous linear equation. The
method represents one of the oldest and best-known pseudorandom
number generator algorithms. These algorithms are also called as
deterministic random bit generators.
The first level involves the usage of the Linear Congruential Generator (LCG).
The third level encrypts data based on the color of the nodes in the tree structure.
First Level
The seed value needs to be agreed upon by the sender and the receiver before data exchange
(Xo)
For our encryption, we use the following values: a=5 ,c=3 ,m=16 ,Xo=0
Representation of
LCG Table Encryption Table
characters using nos
Second level
After the first level of encryption, indices are assigned to the encrypted text and Red-Black
tree is constructed with these indices. Then the constructed Red-Black tree is traversed using
RB Traversal.
After Traversing the Red-Black tree successfully, Rearrange the data according to the new
order of indices obtained by the traversal. This is the second level of encryption which
scrambles the data
Third Level
In Third level of encryption the nodes which are black in color or the data associated with
the indices which are colored black in the Red-Black tree are further encrypted by
incrementing the character by 1.
Flow Diagram For Encryption
Flow Diagram For Decryption
ILLUSTRATION
Encryption
Let the data to be encrypted be: HELLO WORLD
First level
Step 1: Use Table 3 to map the original
characters to encrypted characters.
After mapping we get: MWX ZLHZG SM
Encryption
Table
Second Level
Step 2
After mapping assign indices to the encrypted data received from step 1.
After this construct RB Tree using these indices and perform RB Traversal on the
resulting Tree.
Now the final encrypted text i.e. !XINYZG!MAT M is passed to receiver by the
sender.
Decryption
Now data to be decrypted at receiver side is !XINYZG!MAT M
First Level
Step 1: Construct a Red Black Tree with nodes from 1 to 13 (size of text) as shown