Second Semester Summary

Hello, my name is Syafiq Maharaja. I am a student of binus university majoring computer Science. In this blog, I'm going to write a summary about things i've learned from datastruct so far

1. Circular Singly Linked List

In Single Linked List, we start with the first node and if we are somehow at any node in the middle of the list, we can't access the previous node. But we can solve this problem by changing the structure of a Single Linked List itself. In Single Linked List, the next node is NULL, if we use this link to the point of the first node, then we can reach the nodes that come before the "middle node".
The structure of Single Linked List looks like this :

2. Doubly Linked List

Doubly Linked List is one of Linked List Variations. Double Linked List has a two ways direction and can move back and forth between nodes, which every node has 3 spaces. For the first node, the first space is a NULL and the third space is to point to the next nodes. For the middle node, the first space was to point the previous nodes, and the third space was for the next nodes. And for the last node,  the first space is to point the previous node and the third space is a NULL.
The structure of Double Linked List looks like this : 

3. Circular Doubly Linked List

From what I've read Circular Doubly Linked List is basically a combination of Circular Singly Linked List and Doubly Linked List, which every node can point to the previous nodes or the next nodes while the last nodes points to the first node by next pointer and also the first node points to the last node by the previous pointer.
The structure of Circular Doubly Linked List looks like this :

Hash Table
Hash Table is a method in data struct which stores data in an associative way. In hash table, data is stored as an array, where every data has its own unique index value.



Binary Tree
Binary Tree is a tree that has at most 2 children. Because they only have 2 children, people casually called them left and right child.

Trees: Unlike Arrays & Linked Lists, which are linear data structures, trees are hierarchical data structures.
Tree Vocabulary: The topmost node (example : a) is called root of the tree. The elements that are directly under an element are called its children. The element directly above something is called its parent. For example, ‘d’ is a child of ‘b’, and ‘b’ is the parent of ‘d’. Finally, elements with no children are called leaves.
 tree
      ----
       a    <-- root
     /   \
    b      c  
  /   \      \
 d     e      f    <-- leaves 

Komentar