Heaps A Heap is a special Tree-based data structure in which the tree is a complete binary tree. In general, heaps are classified as: Max-Heap: In a Max-Heap the key present at the root node must be greatest among the keys present at all of its children. The same property must be recursively true for all sub-trees in that Binary Tree. Min-Heap: In a Min-Heap the key present at the root node must be minimum among the keys present at all of its children. The same property must be recursively true for all sub-trees in that Binary Tree. Tries A Trie is a special data structure used to store a group of strings letter by letter in the form of a tree with a maximum of 26 children on each node. the 26 pointers to children nodes represent the 26 letters on the alphabet. This data structure is usually used to represent the "Re trie val" of data, hence the name, Trie. Strings are stored in a top to bottom manner on the basis of their prefix in a trie. All prefix...
Posts
Learning Summary of 2019-2020 even Semester (Dimitri 2301870016)
- Get link
- X
- Other Apps
A link to the programming assignment : here! Singly Linked List Singly Linked List is a type of linked list in which each node has a link to the next one. The first node in a linked list is called a Head and is used as a point to find the rest of the linked list. Doubly Linked List Doubly linked list (DLL) is a type of linked list in which each node apart from storing its data has two links. The first link points to the previous node in the list and the second link points to the next node in the list. The first node of the list has its previous link pointing to NULL similarly the last node of the list has its next node pointing to NULL. Advantages vs singly linked list A DLL can be traversed in both forward and backward direction. The delete operation in DLL is more efficient if pointer to the node to be deleted is given. We can quickly insert a new node before a given node. In singly linked list, to delete a node,...
Hash Table and Binary Tree
- Get link
- X
- Other Apps
Hash Table Hash table is a data structure which stores data in an associative manner. Data is stored in an array format in a hash table, where each data has a unique index value. Thus, the insertion and search of a data can be done in a very short period of time, provided we know the index beforehand. These indexes can be found using a technique dubbed Hashing . Hashing Hashing is a technique to convert certain key values from a data to a range of indexes for an array. There are many ways to hash, the simplest ones include taking the value of key then divide them by the number of available addresses, and take the remainder. The above code does exactly what the example did. However, one can clearly see a problem with it. If 2 keys result in the same hash, then the first hash will be replaced by the second and so on. This phenomena is ca...
Stack and Queue in Data Structures
- Get link
- X
- Other Apps
Stack In Data Structure, a stack is defined as a linear structure in which certain order of operations are performed. The aforementioned operators will most likely include: Push : The addition of an item to a stack. If the stack is full, an Overflow condition is ruled should you use the push operator on it. Pop : The removal of an item from a stack. If the stack is empty, an Underflow condition is ruled should you use the pop operator on it. Peek/Top : Returning the top element of a stack. isEmpty : Checking whether or not a stack is empty. In a stack, this order can either be LIFO (Last In First Out) or FILO (First In Last Out) because they are basically the same things. LIFO or FILO basically means that, in a list of items, the last one to be added will be taken out first. An example of this would be a sta...
Linked List
- Get link
- X
- Other Apps
Doubly Linked List Doubly linked list (DLL) is a type of linked list in which each node apart from storing its data has two links. The first link points to the previous node in the list and the second link points to the next node in the list. The first node of the list has its previous link pointing to NULL similarly the last node of the list has its next node pointing to NULL. Advantages vs singly linked list A DLL can be traversed in both forward and backward direction. The delete operation in DLL is more efficient if pointer to the node to be deleted is given. We can quickly insert a new node before a given node. In singly linked list, to delete a node, a pointer to the previous node is needed. To get this previous node, sometimes the list is traversed. In DLL, we can get the previous node using the “ previous ” pointer. Disadvantages vs singly linked list Every node of DLL require extra space for a previous pointer All operations require the “previous”...