Data Structure and Algorithms Articles

Found 36 articles

Bernoulli Distribution in Data Structures

Arnab Chakraborty
Arnab Chakraborty
Updated on 11-Mar-2026 485 Views

The Bernoulli Distribution is a discrete distribution having two possible outcomes labeled by x = 0 and x = 1. The x = 1 is success, and x = 0 is failure. Success occurs with probability p, and failure occurs with probability q as q = 1 – p. So$$P\lgroup x\rgroup=\begin{cases}1-p\:for & x = 0\p\:for & x = 0\end{cases}$$This can also be written as −$$P\lgroup x\rgroup=p^{n}\lgroup1-p\rgroup^{1-n}$$Example#include #include using namespace std; int main(){    const int nrolls=10000;    default_random_engine generator;    bernoulli_distribution distribution(0.7);    int count=0; // count number of trues    for (int i=0; i

Read More

C++ Program to Implement Trie

Farhan Muhamed
Farhan Muhamed
Updated on 15-Jul-2025 2K+ Views

A Trie, also known as a prefix tree, is used to store and search for large sets of strings. In this section we will discuss all about Trie data structure, its operations, and how to implement it in C++. Trie Data Structure A Trie is a data structure similar to a tree that is used to store a dynamic set of strings. The root node represents an empty string, and each edge represents a character. The path from the root to a node represents a prefix of a string stored in the Trie. The image below show how a ...

Read More

Most Asked Problems on Queue Data Structure in Programming Interviews

Yash Shri
Yash Shri
Updated on 06-Feb-2025 776 Views

A Queue is the data structure used to store and manage the data in a specific order by following the principle of First In First Out (FIFO). The article "Most Asked Problems on Queue Data Structure in Programming Interviews" benefits you by providing good examples of every problem of the tree. It provides the problems from the basic to the hard level. It covers the core and important problems of Queue.Here is the list of queue problems to excel in the ...

Read More

Most Asked Problems on Recursion Algorithm in Coding Interviews

Yash Shri
Yash Shri
Updated on 06-Feb-2025 395 Views

Recursion Algorithm in Data Structure and Algorithms is used to call the function by itself. The article "Most Asked Problems on Recursion Algorithm in Coding Interviews" benefits you by providing good examples of every problem of the recursion. It provides the problems from the basic to the hard level. It covers the core and important problems of the recursion algorithm. The following are the main problems with the recursion algorithm − Easy Recursion Problems Print Pattern Recursively ...

Read More

Top 50 Array Coding Problems for Programming Interviews

Yash Shri
Yash Shri
Updated on 06-Feb-2025 4K+ Views

An array is a linear data structure that stores the data on contiguous memory locations. In this article, we will discuss the most common and popular problems of arrays in Data Structures and Algorithms. We are covering basic to advanced-level problems which will help you to learn the whole concept in a structured manner. Here is the list of problems that have been asked in programming interviews − Easy Array Problems Following are the easy array problems − ...

Read More

Most Asked Problems on Stack Data Structure Asked in SDE Interviews

Yash Shri
Yash Shri
Updated on 06-Feb-2025 736 Views

A Stack is the linear data structure used to store the elements that are inserted and removed by following the principle of Last In First Out (LIFO). The article "Most Asked Problems on Stack Data Structure Asked in SDE Interviews" covers all the problems topic-wise and includes the industry level and important questions from the interview perspective. Here are the important stack problems of Data Structure and Algorithms − Easy Stack Problems Parenthesis ...

Read More

Top 50 Problems on Linked Lists Data Structure Asked in Coding Interviews

Yash Shri
Yash Shri
Updated on 06-Feb-2025 1K+ Views

Linked Lists is the linear data structure that stores the data in the node. In this article, we will discuss the most common and popular problems of linked lists in Data Structures and Algorithms. We are covering basic to advanced-level problems which will help you to learn the whole concept in a structured manner. The following are the most important and best problems on linked lists − Easy LL Problems Print the Middle of a Given Linked ...

Read More

Top 50 Problems on Matrix/Grid Data Structure Asked in Programming Interviews

Yash Shri
Yash Shri
Updated on 06-Feb-2025 696 Views

The matrix or grid data structure is the mix of two or more linear structures. In this sheet, you will find the important and industry-level problems. It will help you clear the programming interviews. This coding problem is organized from a basic level to an advanced level. Following is the range of problems on a matrix in Data Structure and Algorithms − Easy Matrix Problems Check if a Given Matrix is a Magic Square ...

Read More

Most Asked Problems on Graph Algorithm for Coding Interviews

Yash Shri
Yash Shri
Updated on 31-Jan-2025 411 Views

Graph consists of vertices and edges which is a non-linear data structure. In this article, we will discuss the most common and popular problems of graphs in Data Structures and Algorithms. We are covering basic to advanced-level problems which will help you to learn the whole concept in a structured manner. Here are the graph data structure problems from the basics to the advanced level − Fundamentals Problems Here are the basic problems of Graph Data structure − BFS Implementation DFS Implementation Graph Coloring Graph Representation Minimum Spanning Trees (Kruskal's) Minimum Spanning Trees (Prim's) Print Adjacency List Union-Find Data ...

Read More

Most Asked String Coding Problems for Programming Interviews

Yash Shri
Yash Shri
Updated on 31-Jan-2025 881 Views

String is the collection of the characters used to represent the text. It is immutable in many languages. This article gives you deep knowledge and exceptional learning about the Strings with good examples. We cover common and trending coding problems on String in Data Structures and Algorithms from the basic to the advanced level. Here is the list of problems that have been asked in programming interviews − Basic Problems Valid Palindrome with Special Characters String Compression (Run-length Encoding) Reverse Words in Sentence Maintaining Spacing ...

Read More
Showing 1–10 of 36 articles
« Prev 1 2 3 4 Next »
Advertisements