Category: Data Structures
-
Binary Search
Binary Search is a highly efficient algorithm for searching a sorted array or list. Unlike linear search, which checks each element one by one, binary search divides the problem in half with every iteration, making it logarithmic in nature. This reduces the time complexity significantly to O(log n), making it ideal for large datasets. How…
-
DFS (Depth-First Search)
Depth-First Search (DFS) is a graph traversal algorithm that explores as far along each branch as possible before backtracking. It’s one of the foundational algorithms in computer science used for graph and tree-based structures. DFS is widely used in scenarios such as pathfinding, cycle detection, and solving puzzles like Sudoku or mazes. Key Concepts DFS…
-
Linked List
In computer science, a linked list is a fundamental data structure consisting of nodes with data and a reference to the next node. The nodes are liked with each other by pointers. This allows for dynamic memory allocation and efficient insertion and deletion operations as compared to arrays. A linked list is a data structure where the nodes are connected…
-
CIRCULAR LINKED LIST
In CIRCULAR LINKED LIST all the nodes in the linked list are connected circularly. The first and the last node are connected, the NULL is not present in the Circular linked list as the LAST NODE will be connected with the FIRST NODE. A circular linked list is of TWO TYPES: 1) Circular single linked list: A Mix of a…
-
Types of Array
An array in computer programming is a data structure that consists of a collection of elements or data items of the same type, stored in contiguous memory locations. It allows for the organization and manipulation of data in a systematic and linear way. There are 2 types of array. Arrays are commonly used to store…