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 "Retrieval" 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 prefixes of length 1 are stored at until level 1, all prefixes of length 2 are sorted at until level 2 and so on.
Comments
Post a Comment