Pertemuan 4

Tree
Tree is formed by one or many nodes.

Part of Tree:
1. Degree, Level of a particular node on a tree
2. Height, the height of a tree
3. Parent, parent of a node.
4. Children, child of a node.
5. Sibling, node that come from a same parent.
6. Ancestor, nodes in top of node that connected by edges.
7. Descendant, nodes in the bottom of node that connected by edges.
8. Root, node in the most top of a tree.
9. Edge, a line that connect a node to another.
10. Leaf, node which dont have child.

 

Binary Tree
Binary Tree is a tree which its each node has child and max 2 child.

There are many types of Binary Tree
1. Perfect Binary Tree
A tree which each level has the same height
2. Complete Binary Tree
An almost perfect binary tree,
3. Skewed Binary Tree
a tree which each node has maximum of 1 child
4. Balance Binary Tree
a tree which each side (left and right) has the same nodes
Representing Binary Tree with Array
1. 0 index is the root
2. the left child index is 2p+1 while the right child index is 2p+2

Representing Binary Tree with Linked List
struct node {
int data;
struct node *left;
struct node *right;
struct node *parent;
};struct node *root = NULL;

 

Expression Tree Concept
1. Prefix
Output is coming from the top to bottom, left to right.
2. Infix
Output is coming from bottom left to the right and going to the root.
3. Postfix
Output is coming from bottom to top, left to right.

Linked List Implementation II

Stack
Stack is an important data structure which stores its elements  in an ordered manner

Analogy
You must have seen a stack of book. When you need to remove a bottom book, you first need to remove the topmost book. Thats how stack works.

Stack Concept1. Stack  is a linear data structure which can be used  by either using array or linked list
2. Element added and removed is called TOP

Array Representation
Stack has two variables
1. TOP is used to store the address of the topmost element of stack
2. MAX which use to store the maximum number that stack can hold

Stack Operations
1. push(x) = add an item x to the top of stack
2. pop() = remove an item from the top of stack
3. top() = reveal/ return the top item from the stack

There are several applications using stack data structure that we will discuss
1. Infix evaluation
2. Postfix evaluation
3. Prefix evaluation
4. Infix to Postfix conversion
5. Infix to Prefix conversion
6. Depth First Search

 

Prefix : operator is written before operands
Ex: *4 10  // +5 *3 4 // +4/*6 – 5 2 3
Infix : operator is written between operands
Ex: 4 * 10 // 5 + 3 * 4 // 4 + 6 * (5 – 2) / 3
Postfix : operator is written after operands
Ex: 4 10* // 5 3 4* + // 4 6 5 2 – *3/ +1

Depth First Search = A searching method used by data structure to search data start from the bottom, used in stack.

Breadth First Search = A searching method used by data structure to search data start from the side, this operation is used in Queue.

Data Structure Pertemuan 2

Pertemuan kedua kami diisi dengan kehadiran Bapak Bong Defendy. Beliau adalah alumni Binus. Beliau memiliki pengalaman – pengalaman dalam bidang TI dan start up.

Dalam pertemuan kami dengan Bapak Bong Defendy, Beliau memberitahukan beberapa hal sebagai berikut ini:

1. Big Data
Big data adalah sebuah kumpulan kumpulan data yang memiliki ukuran yang sangat besar sehingga kadang kalanya tidak terstruktur dengan baik.
Salah satu contoh penerapan Big Data dapat kita lihat dari perusahaan Google yang mengumpulkan informasi user dan memberikan user hal hal sesuai dengan kebutuhan mereka

2. Cloud
Cloud adalah semacam penyimpanan(storage) dari data data yang kita miliki di suatu daerah yang bukan milik kita. Cloud berfungsi untuk menyimpan data data yang kita miliki tanpa menggunakan memory kita untuk menyimpan data data tersebut

3. Augmented Reality
Pak Bong Defendy juga menjelaskan bahwa di jaman teknologi ini adanya augmented reality dimana kita bisa melihat sebuah benda secara fisik hanya melalui bantuan lembaran kertas dan smartphone.
Saat ini penggunaan Augmented Reality masilah sebatas membantu dalam membangun bangunan, kedepan kalanya mungkin akan lebih berguna lagi

4. Internet of Things
Menyatakan bahwa kita bisa mengatur segala sesuatu melalui internet misalnya berperantara smartphone. Menurut Pak Bong Defendy, komponen terpenting dalam hal ini adalah sensor, tapi logika juga d perlukan. Apa saja yang dapat dilakukan oleh internet of things ini?
Kita dapat mengakses segala perlengkapan yang ada di dalam rumah kita hanya melalui beberapa tombol di smartphone, ini tentunya akan merevolusionisasi teknologi teknologi yang ada di dunia.