
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1860 Articles for Data Structure

105 Views
In this problem, we will find the K points which are nearest to any of the given points from the points given in the array. To find the points which are nearest to the given points, we can take the nums[p] + 1 or nums[p] -1 for each element of the array if it is not present in the array. If we require more points, we can take the nums[p] + 2 or nums[p] – 2 points, and so on. Problem Statement We have given a nums[] array containing the N positive and negative integers. Each point of ... Read More

263 Views
In this problem, we will create a complete binary tree and traverse it in a circular clockwise direction. For the clockwise traversal, we can think of traversing the boundaries of the tree. For example, we can traverse the outer boundary of the tree first. After that, we can remove visited nodes and traverse the inner boundary of the tree. In this way, we need to make min(height/2, width/2) traversal of the given binary tree. Problem Statement We have given a complete binary tree containing N nodes and need to traverse it in a clockwise direction. Sample Examples Input n ... Read More

147 Views
In this problem, we will check whether the left view of the binary tree is sorted. The left view of the binary tree means nodes we can see when we look at the binary tree from the left side. In simple terms, we can see only the first node of each level. So, we need to extract the value of the first node and check whether they are sorted to get the output. Problem Statement We have given a binary tree. We need to print whether the binary tree's left view is sorted. If it is sorted, print 'Yes'. ... Read More

96 Views
In this problem, we will check whether we can connect all K cells by unblocking any single cell. To solve the problem, we will assume all connected K as a single Island. If any single blocked cell can connect all Island of the matrix, it is only possible to connect all K cells of the matrix. So, If the matrix contains more than 4 Island, it is not possible to connect all cells. Problem Statement We have given a mat[] matrix of size n*m. We have also given a positive integer, K. The matrix contains 0 and -1 in ... Read More

238 Views
In this problem, we will traverse each boundary of the given binary tree in the given order. We will use the recursive approach to traverse each boundary of the binary tree one by one. However, we will also learn the iterative approach using a stack to traverse the binary tree's boundary and increase the code's performance. Problem Statement We have given a binary tree, and we need to traverse each boundary of the tree in the given order. Traverse left boundary in top to bottom manner. Traverse bottom boundary from left to right. Traverse the right boundary from bottom ... Read More

428 Views
Introduction Undirected graphs are an essential component of computer science and graph theory, representing a group of nodes connected by edges without any directionality. One common problem associated with undirected graphs is the counting of simple cycles or circuits, which are closed paths that visit each vertex only once. In this article, we will explore how to get total count of the given undirected graph with N vertices using the powerful programming languages C and C++. Undirected Graph Before we jump into coding, let's ensure everyone grasps what constitutes a simple cycle within an undirected graph. Let us consider an ... Read More

1K+ Views
Introduction Graph coloring may be an essential issue in graph hypothesis. The DSatur algorithm presents a compelling approach to play down the utilization of colors while performing chart coloring. By deliberately selecting vertices with the most noteworthy immersion degree, DSatur guarantees an optimized color task that maximizes color differing qualities and minimizes color utilization. In this article, we explore the DSatur calculation for chart coloring and its utilization utilizing C++. The calculation decides its title from the two key concepts it utilizes: Degree and Submersion. It considers the degrees of the vertices and their inundation degrees, which speak to the ... Read More

156 Views
Introduction In graph hypothesis, the user will understand to find the length of the longest expanding grouping of nodes in a specified graph. It includes deciding the longest way in a chart where each hub within the way features a strictly increasing esteem compared to its past node. In this article, we are going investigate three approaches to unravel this issue utilizing C++. Each approach will be clarified in detail, counting the calculation, step-by-step execution, and yield. To guarantee consistency, we'll utilize the same input for all three approaches, and they will create the same yield. Approach 1: Depth-First Search ... Read More

1K+ Views
Introduction The task of making the lexicographically smallest string by replacing characters according to a given relation poses a captivating challenge in string control. The objective is to modify the characters inside the input string, following to the required substitution rules, in arrange to get the littlest lexicographic order. In this article, we'll focus on solving this issue utilizing C++. We are going investigate three approaches to handle this issue, each utilizing a one of a kind technique and algorithmic method. These approaches are planned to supply distinctive bits of knowledge into understanding the issue, considering variables such as effectiveness, ... Read More

213 Views
Introduction Graph theory plays a crucial part in understanding a wide run of real-world issues, counting course optimization, organize examination, and task planning. One interesting issue inside graph theory is the seek for a Hamiltonian way, a way that visits each node in a graph exactly once. This issue has applications in zones such as circuit plan, DNA sequencing, and coordination’s arranging. In this article, we dig into the investigation of diverse approaches to decide on the off chance that it is conceivable to visit each hub in a given chart precisely once, based on certain conditions. We center on ... Read More