- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 1862 Articles for Data Structure
![Rinish Patidar](https://www.tutorialspoint.com/assets/profiles/617319/profile/60_2434475-1678768874.jpg)
4K+ Views
In this problem, we simply need to divide two integers without using multiplication, division and mod operator. Though we can use addition or multiplication or bit manipulation. The problem statement states that we will be given two integers x and y. Without using multiplication, division or mod operator, we need to determine the quotient after dividing x by y. Example INPUT: x=15 , y=5 OUTPUT: 3 INPUT: x=10 , y=4 OUTPUT: 2 INPUT: x=-20 , y=3 OUTPUT: -6 Approach Approach-1(using simple mathematics) In this approach, we will use a simple mathematics algorithm. Below is the step-by-step illustration of the ... Read More
![Rinish Patidar](https://www.tutorialspoint.com/assets/profiles/617319/profile/60_2434475-1678768874.jpg)
152 Views
A figurative number that depicts a dodecagon is called a dodecagonal number. The Centered Dodecagonal number is represented by a dot in the centre and other dots encircling it in the successive dodecagonal (i.e. a 12-sided polygon) layers. Centered Dodecagonal number can be better explained with the below figure. For n=1, only a single dot will be there in the centre. So the output will be 1. For n=2, a single dot in the centre followed by a dodecagon encircling it. Thus, the total number of dots will be 13. So the next centred dodecagonal number ... Read More
![Mallika Gupta](https://www.tutorialspoint.com/assets/profiles/616724/profile/60_2138235-1678687177.jpg)
276 Views
Strings are the storage elements for storing different kinds of letters and symbols. It is indicative of a stream of characters in C++. Strings are denoted in double quotes or single quotes. The given input string can be comprised of both uppercase and lowercase characters. The problem statement is to change the case of the characters of the string, in such a way that the letter which was originally written in lowercase is converted into uppercase and vice versa. Some of the examples illustrating the problem statement are as follows − Sample Examples Example 1 : "AbCd" Output : bAdC ... Read More
![Eva Sharma](https://www.tutorialspoint.com/assets/profiles/614747/profile/60_1298397-1678427862.jpeg)
781 Views
A Perfect Power is a Natural Number that is the product of equal natural factors. It can also be defined as an integer that can be expressed as a square power or a higher power of another integer greater than one. For example, 4 can be expressed as the product of 2*2. 27 can be expressed as the product of 3*3*3. Hence, 4 and 27 are perfect powers. Problem Statement Given a number n, find the count of perfect numbers which are less than or equal to n. Example 1 Input = 14 Output = 3 Explanation 1 ... Read More
![Eva Sharma](https://www.tutorialspoint.com/assets/profiles/614747/profile/60_1298397-1678427862.jpeg)
188 Views
The Legendre’s Conjecture states that at least one prime number always exists between two consecutive natural numbers' squares. Mathematically, there is always a prime number p between any two numbers n2 and (n+1)2. n is a natural number. A conjecture means a conclusion that doesn't has mathematical proof. Hence, Legendre's Conjecture is just a statement with no mathematical proof. Problem Statement For a number n, print the number of primes in the range of n2 to (n+1)2 from 1 to n. Examples Input: 4 Output: For i = 1: Total primes in the range 1 and 4 = 2 ... Read More
![Eva Sharma](https://www.tutorialspoint.com/assets/profiles/614747/profile/60_1298397-1678427862.jpeg)
84 Views
What are Corner digits? The corner digits of a number refer to the rightmost and the leftmost digits. For example, the corner digits of 1234 are 1 and 4. The corner digits of a single-digit number will be the number twice. For example, the corner digits of 2 will be 2 and 2. Problem Statement For given two numbers, n, and x, form a number using the corner digits of all the powers of n from 1 and x, i.e., n1, n2....nx. Examples Input: n = 2, x = 4 Output: 22448816 Explanation 21 = 2. Corner digits = ... Read More
![Eva Sharma](https://www.tutorialspoint.com/assets/profiles/614747/profile/60_1298397-1678427862.jpeg)
987 Views
Gray code or reflected binary code is a form of a binary representation of numbers in which two consecutive numbers only differ by one bit. For example, the gray code of 1 is 001, while the gray code of 2 is 011. Gray code is usually used in error correction because it prevents some data errors that can happen in the usual binary representations while state changes. Gray code is also helpful in k-maps, communication, etc., because of its unique property. Prerequisite Study decimal, binary and gray code notations before reading further. Problem Statement 1 Given a decimal number n, ... Read More
![Eva Sharma](https://www.tutorialspoint.com/assets/profiles/614747/profile/60_1298397-1678427862.jpeg)
195 Views
Cube-free numbers are those numbers that have no cubic divisors. A cubic divisor refers to an integer that is a cube and divides the number with zero remainders. For example, 8 is a cubic divisor of 16 since 8 is a cube of 2 (2*2*2 = 8), and 8 divides 16 with the remainder of zero. Thus, 8 and 16 both are not cube-free numbers. Problem Statement Find all the cube-free numbers less than a given number, n. Example Let's understand the problem with an example. Let n = 15, Thus, we have to find all the numbers less than ... Read More
![Eva Sharma](https://www.tutorialspoint.com/assets/profiles/614747/profile/60_1298397-1678427862.jpeg)
211 Views
A Square Pyramidal Number means the Sum of the Square of Natural Numbers. Natural Numbers include all the numbers from 1 to infinity. For example, the first 4 Square pyramidal numbers are 1, 5, 14, 30. For better perception, consider the fact: If we take spheres of numbers equal to the square pyramidal numbers, starting from one, and stack them in descending order, they create a pyramid. Problem Statement Given a number Sum. If Sum is the sum of the squares of first “n” natural numbers, return n, otherwise return false. Example 1 Input = 30 Output = 4 ... Read More
![Sonal Meenu Singh](https://www.tutorialspoint.com/assets/profiles/605896/profile/60_1123519-1677042019.jpeg)
1K+ Views
Introduction In this tutorial, we will learn about the in-memory queue in the data structure. A queue is a general data structure that inserts and removes elements with some pattern. It uses the First In First Out approach for its processing. An array and linked lists are used to implement a queue. In-Memory Queue A queue can be visualized as a continuous memory (using an array queue) for storing data types. It is stored in secondary memory. In-memory Queue is different from a simple queue only in terms of its storage area. It is stored in the RAM of your ... Read More