Postingan

Menampilkan postingan dari Maret, 2020

Binary Search Tree

Gambar
Binary Search Tree Hello again, welcome at my blog. At this moment, I am going to talk about 'Binary Search Tree'. What is Binary Search Tree? Is it same with Binary Tree? I will explain all of them here. What is Binary Search Tree? Binary search tree is a data structure that quickly allows us to maintain a sorted list of numbers. It is called a binary tree because each tree node has maximum of two children. It is called a search tree because it can be used to search for the presence of a number in O(log(n)) time. The properties that separates a binary search tree from a regular binary tree is All nodes of left subtree are less than root node All nodes of right subtree are more than root node Both subtrees of each node are also BSTs i.e. they have the above two properties The binary tree on the right isn't a binary search tree because the right subtree of the node "3" contains a value smaller that it. Is Binary Search

Hashing, Hash Tables, and Binary Tree

Gambar
Hashing, Hash Tables, & Binary Tree Hello, welcome back to my blog, at this moment we going to talk about 'Hashing, Hash Tables, and Binary Tree'. What is hashing, hash tables, tree and binary tree? We are going to learn about them here. Hashing 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. The efficiency of mapping depends of the efficiency of the hash function used. Let a hash function H(x) maps the value x  at the index  x%10  in an Array. For example if the list of values is [11,12,13,14,15] it will be stored at positions {1,2,3,4,5} in the array or Hash table respectively. As a simple example of the using of hashing in databases, a group of people could be arranged in a database like this: Abernathy, Sara Epperdingle, Roscoe Moore, Wilfred Smith, David (and many more sorted into alphabetical orde
Gambar
Single Linked List First of all, what is Linked List? Linked List is pretty similar to array, but Linked List is  a linear data structure. Unlike arrays, linked list elements are not stored at a contiguous location; the elements are linked using pointers. ///Then, what is special about Linked Lists? Are they are just similar to Array?/// Even though array and linked lists are pretty similar, but there is some differences between arrays and linked lists. Here is the difference between array and linked list. What is Single Linked List? Single Linked List is a type of Linked Lists that only have a single pointer variable that points to the next element that will leads to the tail of Linked List, and the tail will points NULL.  here is the illustration of Single Linked List : P. S. : Head is the first element of Linked List and Tail is the last element of Linked List example of ' struct ' code : struct Scholar{       char name[25];  

Linked List

Gambar
Linked List Halo semuanya, topik kita kali ini adalah Linked List. Pertama-tama, apa itu Linked List? Linked List adalah suatu struktur data yang terdiri atas urutan data-data dan setiap data menyimpan petunjuk data yang berada di urutan berikutnya. Sistem pengurutan pada Linked List tidak berdasarkan penempatan fisik suatu data, melainkan setiap data menunjukkan data yang lainnya. Dalam Linked List, kita juga dapat melakukan deletion  (penghapusan suatu elemen dalam struktur data) ataupun insertion (penambahan elemen ke dalam struktur data). ///Jadi kira-kira apa bedanya Linked List dengan Array bang???/// Oke, mungkin jika dilihat secara sekilas, Array dan Linked List memiliki beberapa persamaan, namun keduanya memiliki perbedaan yang cukup signifikan lho. Perbedaannya dapat dilihat dibawah ini. ///Perbedaan Array dan Linked List/// Nah, Linked List itu terbagi atas beberapa jenis antara lain sebagai berikut. 1. Single  Linked List Single Link