Posts

Image
Binary Tree Binary Tree is a tree in a hierarchical data structure (one to  many relationship). A tree can be defined as a collection of vertices with each node having at most two children. Specifically, their children are named left and right. Binary trees do not have more than three levels from Root. Binary tree is a tree with the condition that each node (node) can only have a maximum of two subtree and the two subtree must be separate. Each node in a binary tree can have at most two children, the child specifically named left and right. Binary trees can also be stored as implicit data structures in arrays, and if the tree is a complete binary tree, this method does not waste a place. In this tight arrangement, if a node has index i, its child can be found at index 2i + 1 and 2i + 2, even though the father (if any) is found at the index floor ((i-1) / 2) (assume the root has an empty index). Binary Search Tree Binary Search Tree is an ordered tree (ordere...

Struktur Data

Image
Linked List Linked List adalah bagian dari Struktur Data. Linked list atau dikenal juga dengan sebutan senarai berantai adalah struktur data yang terdiri dari urutan record data dimana setiap record memliki field yang menyimoan alamat/ referensi dari record selanjutnya (dalam urutan) elemen data yang dihubungkan dengan link pada linked list disebut Node. Pada linked list, terdapat istilah push, dan pop dimana push berarti insert data baru pada linked list tersebut, dimana kita bisa push dari depan(dimana data yang kita masukkan berada di paling depan linked list kita dan data yang kita masukkan tersebut menjadi head), belakang (dimana data yang kita masukkan akan berada di paling belakang linked list kita dan data yang kita masukkan tersebut menjadi tail) atau dari tengah( data yang kita masukkan bukan berada di head maupun tail, melainkan berada di tengah-tengah linked list). Sedangkan pop berarti mendelete data, data dari depan, tengah dan juga belakang. Pada linked list...