Category: Data Structures
-
Graphs : Dijkstra Algorithm
Dijkstra’s algorithm is a fundamental graph traversal technique used to find the shortest path from a single source node to all other nodes in a weighted graph. Developed by Edsger W. Dijkstra in 1956, the algorithm operates efficiently by iteratively exploring the least-cost paths. It is widely employed in network routing, GPS navigation, and resource…
-
Big Omega
Big Ω (Omega) notation is a mathematical concept used to describe the best-case performance of an algorithm. It provides a lower bound on the running time or space required by an algorithm as a function of the input size . In simpler terms, Big Ω defines the minimum time an algorithm will take, regardless of…
-
Unbalanced tree
An unbalanced tree is a binary tree where the height difference between the left and right subtrees of any node can become significant, leading to an inefficient structure. Unlike balanced trees, which maintain a relatively equal height across subtrees, unbalanced trees may degenerate into a linear structure, similar to a linked list. This can result…
-
Balanced Tree
A balanced tree is a type of binary tree where the height difference between the left and right subtrees of any node is minimal, ensuring efficient performance in terms of searching, insertion, and deletion operations. This balance is crucial for maintaining the tree’s height at a logarithmic scale, which ensures that operations can be performed…
-
Graphs : DFS
Depth-First Search (DFS) is a fundamental graph traversal algorithm that explores as far as possible along each branch before backtracking. It is widely used in computer science for tasks such as solving puzzles, finding connected components, topological sorting, and detecting cycles in graphs. DFS operates on both directed and undirected graphs and works for graph…
-
Graph : BFS
Breadth-First Search (BFS) is a fundamental graph traversal algorithm that explores all vertices at the current depth level before moving to the next level. It is widely used in various applications, such as finding the shortest path, solving puzzles, and network flow analysis. BFS works efficiently on both directed and undirected graphs, represented as adjacency…
-
Graphs : Beelman Ford Algorithm
The Bellman-Ford algorithm is a powerful graph-based algorithm used to find the shortest paths from a single source vertex to all other vertices in a weighted graph. Unlike Dijkstra’s algorithm, Bellman-Ford can handle graphs with negative weight edges, making it a versatile choice for a wide range of applications. However, it cannot work with graphs…
-
Graphs : A* Algorithm
The A* algorithm is a widely used graph traversal and search algorithm, ideal for finding the shortest path between two nodes. It combines the strengths of Dijkstra’s algorithm and Greedy Best-First Search by using a heuristic to guide its search, making it both efficient and optimal. Commonly utilized in navigation systems, robotics, and artificial intelligence,…
-
Searching algorithm : DSA
Search algorithms are fundamental in computer science and are used to retrieve data from a collection of elements efficiently. They are employed in a wide range of applications, from databases and file systems to artificial intelligence and optimization problems. This article delves into the key types of search algorithms, their mechanisms, and applications. 1. Types…
-
Hash Map
A Hash Map (or Hash Table) is one of the most fundamental and widely used data structures in computer science, providing an efficient way to store key-value pairs. The primary operation in a hash map is the ability to associate a key with a value, and retrieve that value in near constant time. This makes…
-
JSON : (Data Interchange Format)
JSON (JavaScript Object Notation) is a lightweight data-interchange format that is widely used for storing and exchanging structured information between systems. Its simplicity, flexibility, and language-agnostic design make it a cornerstone of modern web development, API design, and data serialization. JSON structures data using key-value pairs, arrays, and objects, making it both human-readable and machine-parsable.…
-
Image compression
Image compression is a crucial process in the digital world, allowing for the reduction of image file sizes while maintaining quality, which is essential for optimizing storage, bandwidth, and performance. It involves removing redundant data from image files, using algorithms to encode image information efficiently. The process can be classified into two categories: lossless and…
-
BFS (Breadth-First Search)
Breadth-First Search (BFS) is a graph traversal algorithm that explores all the vertices of a graph level by level, starting from a given source vertex. BFS is often used in unweighted graphs to find the shortest path between two nodes, solve puzzles like mazes, and perform other graph-based analyses. BFS Algorithm Overview BFS uses a…
-
Time Complexity (Code Time Optimization)
Time complexity is a measure in computer science that evaluates the amount of time an algorithm takes to complete based on the size of its input. It describes the growth rate of an algorithm’s running time as the input data grows, providing insight into the efficiency and scalability of the algorithm. Time complexity is crucial…
-
Big – O – Notation (time & space complexity)
The Big-O notation is a mathematical concept used in computer science to describe the efficiency of an algorithm based on its time or space complexity as the input size grows. It provides a way to measure the upper limit of an algorithm’s performance, helping developers estimate scalability and potential bottlenecks. Key Concepts of Big-O Notation…
-
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…