Wednesday, March 25, 2020

Binary Tree

Binary Tree
A tree whose elements have at most 2 children is called a binary tree. Since each element in a binary tree can have only 2 children, we typically name them the left and right child. the speed of searching in binary tree is O(nlogn) that means that it runs faster as binary search. the concept of binary tree is similar to double linked listed but it has 2 pointer which point to left and right. the function of using binary tree is to check a number with fast search.



Sunday, March 15, 2020

Hash Table and Binary Tree

Hash Table
Hash Table is a data structure that storing data in array. the purpose of hash table is to make the fast searching if you want to search for the data in the array with using a key to find a direct index.

                                          Picture 1.1,

Using hash table we calculate our data into the key with anyway and the key will refer to the index. that is why we can find our data with speed O(1). but there is some problem when we make hash table, it is collision. collision is when your data data is being stored in the same array with the another data because the key is the same.

How to fix a collision in our hash table? to fix the problem we can use linked list into our hash table.
to be exact you can see the picture number 1.1 it's already describe the solution if collision occur.


Binary Tree
Binary tree is implementation of linked list. in Binary tree we have 2 references which refer to left and right. the top of the node is called "root" and the bottom one is called "leaf". to find a data binary tree speed is O(n log(n)) but the data is already been sorted from the start.

The example of binary tree:


Block Chain
Block chain is linked every record (or box) with each other using public key and private key.
in current technology, block chain is used for making cryptocurrency such as bit coin. block chain can be implement at business at financial support example is Asset Management: Trade Processing and Settlement.

Source :
https://www.cs.cmu.edu/~adamchik/15-121/lectures/Trees/trees.html
https://www.researchgate.net/profile/Erin_Hastings/publication/228958917/figure/fig1/AS:340199050629120@1458121182977/An-example-of-mobile-objects-in-a-grid-a-hash-table-and-the-object-index.png
https://blockgeeks.com/guides/blockchain-applications/

Learn More :
https://www.youtube.com/watch?v=KyUTuwz_b7Q
https://blockgeeks.com/guides/blockchain-applications/