DSA: Heap June 10, 2023 Algorithm / Data Structure A heap is a specialized tree-based data structure that satisfies the heap property. It is commonly used to implement priority queues and efficient sorting algorithms like heap sort.
DSA: Trie May 31, 2023 Data Structure What is a Trie in DSA? A trie, often known as a prefix tree, is a tree-like data structure used for fast string searching and prefix matching. It allows for the quick retrieval of words or keys connected with each node. The word Trie is derived from reTRIEval, which means finding something or obtaining it. […]
Trees: Lowest Common Ancestor May 30, 2023 Data Structure What is the Lowest Common Ancestor? In a tree, the lowest common ancestor (LCA) of two nodes, n1 and n2, is the shared ancestor located farthest from the root and has both n1 and n2 as descendants. Properties of the Lowest Common Ancestor: An LCA can be one of the input nodes themselves if one […]
Binary Search Tree (BST) May 29, 2023 Data Structure A Binary Search Tree (BST) is a type of binary tree that satisfies the following properties: For any node in the tree, all values in its left subtree are less than its value. For any node in the tree, all values in its right subtree are greater than its value. The left and right subtrees […]
Queues in DSA May 26, 2023 Data Structure What is a Queue in DSA? A queue is a linear data structure that holds elements in a certain order. It accesses items using the FIFO (First In First Out) method. It can only be changed by adding data entities at one end or removing data entities at the other. The end where insertion occurs is known as the Rear, while the end where deletion occurs is known as the Front. This ordering guarantees that components are processed […]
Stack in DSA May 23, 2023 Data Structure What is a Stack? A stack is an abstract data type that adheres to the Last-In-First-Out (LIFO) principle in the context of data structures and algorithms (DSA). It’s a linear data structure with operations like push (adding an element to the top) and pop (removing the topmost element). Note: A stack can be visualized as […]
Pointers in DSA May 22, 2023 Data Structure What are pointers? Pointers are variables that are used to save the position of a value in memory. A memory address is stored in a pointer to a location. Pointers are a key notion in data structures and algorithms (DSA) that provide significant memory management and data manipulation capabilities. Understanding pointers allows programmers to optimize […]
DSA: Strings Pattern Matching May 21, 2023 Data Structure What is Pattern Matching? Pattern matching is a fundamental problem in computer science that is employed in a wide range of applications. Pattern matching in the context of strings refers to detecting instances of a given pattern (substring) inside a bigger string. Algorithm for Pattern Matching: There are several popular algorithms and techniques for string […]
DSA: Binary Search May 19, 2023 Data Structure What is Searching? Searching is a fundamental process in computer science that is commonly used to locate certain items or values within a data structure. Depending on the qualities of the data and the specific requirements of the search, different data formats and algorithms are used for searching. What is Binary Search in DSA? Binary […]
DSA: Types of Tree May 17, 2023 Data Structure There are various varieties of trees that are often used in the context of Data Structures and Algorithms (DSA). Here are a few of the most important: Binary Tree: A binary tree is a type of tree data structure in which each node can only have two children. The left child is the left subtree, […]