seharusnya hari ini jadi jadwal kelas besar Data Structure di ruang 400 auditorium. namun jadwal hari ini diganti menjadi GSLC dari F2F
topic hari ini adalah Hashing table & Binary tree
Hashing Data Structure
Hashing is an important Data Structure which is designed to use a special function called the Hash function which is used to map a given value with a particular key for faster access of elements.
source : geeksforgeeks
menurut wikipedia : In computing, a hash table (hash map) is a data structure that implements an associative array abstract data type, a structure that can map keys to values. A hash table uses a hash function to compute an index, also called a hash code, into an array of buckets or slots, from which the desired value can be found.
jadi apasih hash table sebenarnya? hash table itu simplenya sebuah tabel yang berfungsi untuk memetakan kunci yang unik (Unique Key) untuk setiap baris (record) menjadi angka (hash).
keunggulan hash table
- Main advantage is synchronization.
- In many situations, hash tables turn out to be more efficient than search trees or any other table lookup structure. For this reason, they are widely used in many kinds of computer softwares, particularly for associative arrays, database indexing, caches and sets.
sumber : geeksforgeeks
contoh hashtable data structure
source : https://youtu.be/MfhjkfocRR0
Binary Tree Data Structure
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.
source image : geeksforgeeks
Binary Tree node berisi beberapa bagian
- Data
- Pointer to left child
- Pointer to right child
Binary tree adalah tree yang hanya dapat memiliki dua percabangan saja.
Advantages of trees
Trees are so useful and frequently used, because they have some very serious advantages:
- Trees reflect structural relationships in the data
- Trees are used to represent hierarchies
- Trees provide an efficient insertion and searching
- Trees are very flexible data, allowing to move subtrees around with minumum effort
source : geeksforgeeks
source : https://youtu.be/H5JubkIy_p8
Tidak ada komentar:
Posting Komentar