HASHING TABLE AND BINARY TREE
Hash Table
Hash table is a data structure that stores data in an array format, where each data has a unique index value. With hashing, access to data will become faster.

Syntax of hash table:
struct DataItem {
int data;
int key;
};
Hash methods:
int hashCode(int key){ return key % SIZE; }
Binary Tree
A binary tree is a tree whose elements have maximal 2 children. The binary tree contains:
1. Data
2. Pointer of the left child
3. Pointer of the right child

tree
----
j <-- root
/ \
f k
/ \ \
a h z <-- leaves
Syntax of a binary tree:
References: https://www.geeksforgeeks.org/binary-tree-data-structure/#Introduction
https://www.geeksforgeeks.org/binary-tree-set-1-introduction/
https://www.geeksforgeeks.org/binary-tree-set-1-introduction/
Comments
Post a Comment