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 […]
May 21, 2023 | Data Structure | No comments
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 […]
May 19, 2023 | Data Structure | No comments
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, […]
May 17, 2023 | Data Structure | No comments
What is Tree Data Structure? A tree data structure is made up of nodes that are connected via edges. The root node is the topmost node in a tree, and it is connected to zero or more child nodes. Each child node can have zero or more child nodes attached to it, establishing a hierarchical […]
May 14, 2023 | Data Structure | No comments
Let us see a few problems based on Linked List. Given a linked list of N nodes such that it may contain a loop. A loop here means that the last node of the link list is connected to the node at position X(1-based index). If the link list does not have any loop, X=0. Remove the […]
May 14, 2023 | Data Structure | No comments
What is a Linked List? A linked list is a linear data structure composed of nodes, each of which holds a value and a reference (or pointer) to the next node in the list. The first node is referred to as the list’s head, while the last node is referred to as the list’s tail. […]
May 14, 2023 | Data Structure | No comments
What is Recursion? In computer science, recursion is a strong programming technique that is used in many algorithms and data structures. In the context of data structures and algorithms, recursion refers to a function calling itself to solve a problem or conduct a computation, either directly or indirectly. Working & usage of Recursion in DSA: […]
May 13, 2023 | Data Structure | No comments
What is Collision in Hashing? In hashing, collisions occur when two or more keys yield the same hash value or hash code. Collisions are unavoidable because hash algorithms transfer a theoretically unlimited collection of keys to a finite range of hash results. We have certain collision strategies that we can use to resolve these problems. […]
May 12, 2023 | Data Structure | No comments
What is Hashing? Hashing is a computer science technique for mapping arbitrary-size input to a fixed-size result. A Hash table is a data structure that stores some information, and the information has basically two main components, i.e., key and value. Cryptography, data indexing, data retrieval, and checksum creation are among applications that employ hash functions. […]
May 6, 2023 | Data Structure | No comments
In the previous post, we got an introduction to Strings and their methods. Let us now take a look at a few problems related to it. Given a string s, return the longest palindromic substring in s. Example: Input: s = “babad” Output: “bab” Explanation: “aba” is also a valid answer. Solution: Time complexity: O(n^3), where n is the length […]
May 3, 2023 | Data Structure | No comments