Articles for category: Data Structures and Algorithms

Deterministic and Non-Deterministic Algorithms

An algorithm is a group of clearly defined steps used in programming to carry out certain tasks and produce desired results. When we refer to “a set of defined instructions” in this context, we mean that the user is aware of the results of those instructions if they are carried out as intended. Deterministic and ...

Common Operations of Data Structures

People have been referring to computer information that is communicated or stored as “data” since the development of computers. On the other hand, order types also contain data. Data might take the shape of printed numbers or sentences and bytes saved in the memory of electrical devices or knowledge that has been mentally preserved. This ...

Coin Change Problem

Introduction to Coin Change Problem The “coin change problem” expects a solution to find the minimum number of specific denomination coins required to sum up to a given value. This problem can be categorized as a variation of the “knapsack problem”, and the solution can be optimized using the Dynamic Programming approach. So let’s get ...

Count Triplets

Problem Statement An array of integers with the length n is presented to us as Arr[]. The objective is to determine the quantity of triplets (Arr[i],Arr[j],Arr[k]) such that any two numbers added together equal the third number. Example a, b, and c are members of Arr[] with indexes i, j, and k, respectively, such that ...

Detect Cycle in Directed Graph

Problem Statement Given a Directed graph $G=(V, E)$ with $V$ vertices numbered from $0$ to $V-1$ and $E$ edges. The task is to detect cycle in the directed graph $i.e.$ to check if there exists a cycle in the given graph. Examples Example 1 Input: Output:NO Explanation: No cycle exists in the above give Directed ...

Applications of Stack in Data Structure

A Stack is a linear data structure that processes elements in a last in first out (LIFO) manner, with the most recent element always on top. Push() and pop() operations are usually supported. Applications of stack in data structure includes expression evaluation, backtracking, recursion and the implementation of other data structures such as queues. Applications of Stack ...

Advanced Data structures

Data structures are fundamental components in data science, enabling efficient storage, organization, and manipulation of information. Mastery of advanced data structures is vital for programmers, as they underpin the design and implementation of effective algorithms and software systems. The efficiency of algorithms often hinges on the choice and implementation of data structures, influencing both time ...

Container with Most Water

Problem Statement You are given an array $height[n]$ of integers of size n, where each value represents a coordinate position $(i, height[i])$. n vertical lines are drawn such that the endpoints of line i are at $(i, 0)$ and $(i, height[i])$. Find the container that is formed by two lines along with the x-axis, where the container ...

Complete Roadmap To Learn DSA

Data Structures and Algorithms is the most important subject in the world of Software and Computer Science. Data Structures and Algorithms are the base of every application which is built using coding, it can be a web application or a mobile application. It is used to solve any problem most efficiently. The **utilization of time and space ** ...