Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Queue Amazon Amazon

An Interesting Method to Generate Binary Numbers from 1 to n

Given a number n, write a function that generates and prints all binary numbers with decimal values from 1 to n. Examples: Input: n = 2 Output: 1, 10 Input: n = 5...
Arrays Dynamic Programming Hash

Number of NGEs to the right

Given an array of n integers and q queries, print the number of next greater elements to the right of the given index element. Examples: Input : a[] = {3, 4, 2, 7, 5...
Arrays Stack Arrays

Print next greater number of Q queries

Given an array of n elements and q queries, for each query which has an index i, find the next greater element and print its value. If there is no such greater elemen...
Queue Stack Strings

Minimum number of bracket reversals needed to make an expression balanced

Given an expression with only ‘}’ and ‘{‘. The expression may not be balanced. Find minimum number of bracket reversals to make the expr...
Stack number-digits Stack

Count natural numbers whose all permutation are greater than that number

There are some natural number whose all permutation is greater than or equal to that number eg. 123, whose all the permutation (123, 231, 321) are greater than or equ...
Arrays Stack Strings

Form minimum number from given sequence

Given a pattern containing only I’s and D’s. I for increasing and D for decreasing. Devise an algorithm to print the minimum number following that patte...
Mathematical Stack number-digits

Reverse a number using stack

Given a number , write a program to reverse this number using stack. Examples: Input : 365 Output : 563 Input : 6899 Output : 9986 ...

Subscribe to Our Newsletter