AVL TREE In Computer Science term an AVL tree is a type of self-balancing binary tree. The word AVL come from it's inventor A delson- V elsky and L andis. It's the first of such Data Structure. The term self-balancing mean that an AVL tree will maintain both of it's subtree height so that their height diffenrence will be 1, -1, or 0. This is called the balance facotr of an AVL tree. Basically an AVL tree is like an Binary Search Tree but with an self-balancing function built into it. Why Use an AVL Tree The reasoning to why we must balance the tree if it's not balanced is so that the time complexity for the operation (Search, Insert, Delete) will always be at O(log n) instead of the usual O(h) (where h is the height of the tree ) for the worst case scenario. Example of a skewed tree For the tree above say that we want to search for the node 74 that we have to traverse the entire tree to find said note but if it's an AVL tree then We on...
POINTER Pointer is a type of variable in C. It differentiate from other variable is that it can contain the memory address of other variable. Pointer can be declared as such : int *ptr; -> ptr is a pointer that point to a variable that contain an integer. Pointer can also point to another pointer and is called double pointer. ARRAY Array is a type of data structure that can store a fixed amount of variable. In shorter term array is a collection of variable that has the same data type. Array can be declared as such : int arr[10]; -> arr is an array of integer that can store a maximum of 10 integer. LINKED LIST Linked is a type of data structure that store it's data in a node(struct) that is connected together via link. Each node contain a reference to the next node and/or a reference to the previous node. Linked List is second most used data structure after array. There are two most used type of linked list : 1. Single Linked List 2. Double/Doubly Linked Lis...