Articles for category: Data Structures and Algorithms

Data Structures and Algorithms Made Easy

Data Structures is a way to arrange data, and algorithms are the sequence of steps we would take to solve a given problem using those data structures. Data Structures and Algorithms (short for DSA) are an essential part of a programmer’s life; whether you are a Competitive Coder or a keen Developer, Data Structures are a ...

Analysis of Algorithm

An algorithm is a step-by-step set of instructions, which are meaningful and used to solve any particular problem. To perform every process, there is a set of Algorithms, which lets us know how to proceed with the problem and solve it in some steps. The analysis of an algorithm is a technique that measures the performance of an ...

Delete a Node from Linked List

A linked list is a linear data structure that consists of nodes where each node has two fields. The first field is the data field, and the second field is the address field, which is a reference(link) to the next node. We can perform various functions in a linked list, like insertion, deletion, searching, sorting, and many ...

Arithmetic Progression

A progression is a sequence of numbers that shows a pattern. The arithmetic progression is the most widely used mathematical progression, and it occurs when the difference between every two consecutive terms in a series is same. It is also known as an arithmetic sequence. Let’s say we have a series of even numbers (2, ...

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 ...