
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 7197 Articles for C++

484 Views
This article is about how we can sort an array by neglecting a subarray of elements present in the same array. We will discuss two approaches for the same. The first approach is a brute force approach with time complexity O(n*n) while the second approach is by using an additional space to keep the sorted part of array other than the subarray. The time complexity of second approach is better i.e., O(nlogn). Problem Statement We are given an array of positive integers “nums” and two indices of the same array namely- left and right and we have to partially sort ... Read More

286 Views
In this article, we will learn what an undulating number is and our approaches to check whether a given number is undulating or not using a boolean function to check undulating numbers. Problem statement We will be given a number and our task is to check whether the given number is undulating. Let us first learn about an undulating number; An undulating number is a number that only consists of two types of digits and every second digit is the same. We can say an undulating number is of the form “PQPQPQ” where P and Q are two different digits ... Read More

460 Views
We will discuss two approaches to solve the sword puzzle. In the first approach, we will use circular linked list, while the second approach is based on general intuition. In this article, we will discuss what is a sword puzzle problem and how we can solve a sword puzzle problem. Problem Statement We have an arrangement of n people in a circle in which, first person is carrying a sword. The first person kills the second person and hands over the sword to the next alive person in the circle. Now the next person carrying the sword kills the next ... Read More

359 Views
We will discuss triangular numbers and how we can find the smallest triangular number just larger than a given number “num”. We will first discuss what exactly is a triangular number and then will find out the smallest triangular number just larger than “num” We will see two different approaches for the same. In the first approach, we will run a simple loop to generate the output, while in our second approach, we will first generate a general formula for calculating the desired number and then will directly apply that formula to get the smallest triangular number. Problem Statement We ... Read More

347 Views
We are given two numbers and our task is to find out whether the given number is obtained by multiplying two other numbers such that all three numbers together constitute a 9-digit pandigital number. In other words, it can be said that we have to find out whether the given number is pandigital after combining it with two other numbers which result in the original number on multiplication. We can have many such cases where we will get multiple solutions for this problem, to get the best time complexity, we will simply print the first ever solution found and stop ... Read More

914 Views
There are different approaches, we can use to minimize the number of swaps required on adjacent elements to get a sorted array. The given array as the output only contains two types of elements i.e., 0 and 1. We will discuss two different approaches to solve the problem in which the first solution uses extra space to store the number of zeroes, while the second one uses only constant space. Problem Statement We are given an array which contains only two types of elements 0 & 1. Our aim is to find out how many minimum swaps on adjacent elements ... Read More

671 Views
An array is a collection of similar data sets which stored at adjacent memory locations in a continuous manner. It makes the process easier to evaluate the particular position of each and every element by defining an offset value to the particular base value of a database. The base value of that particular index is zero and an offset is a value of the difference of two particular indexes. A subarray is a section of a particular array which can be defined as a set of variables collectively with a label of multiple values. The longest subarray means in which ... Read More

476 Views
In the field of data structure, a range query is a pre-processing method to operate on some input data in an efficient manner. A range query is responsible to answer any query of the particular input on any data subset. If we want to copy some data columns from a table we need to maintain an index for that particular dataset. An index is a direct link or a key, which is designed to provide an efficient searching process in a data set. It is mainly used to speed up the data retrieving from a lost data source. In mathematics, ... Read More

642 Views
A string is an object, which represents a sequence of data characters. The strings are the data container which always represented as a text format. It also used to concept, compare, split, join, replace, trim, length, intern, equals, comparison, substring operation. K largest(or smallest) elements in an array using Quick Sort partitioning algorithm. Here is an array R[] with N number of distinct integers. The task is to find that particular element which are strictly greater than all the elements preceding it and strictly greater than at least K elements on its right. The problem states that an array ... Read More

256 Views
Ranging a query is a common database current interest operation present in data structure to restore all the records where the output value lies between an upper and lower boundary. This process works with some input data, to structure them in an efficient manner on any subset of a particular input. The range function, denoted as range(), is used to iterate a for loop over a series. We need to declare the start as 0 at the beginning of a process. If somehow we miss this step, the process will run and iterate the loop until the end (-1). A ... Read More