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...

Share

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...

Share

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...

Share

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

Share

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...

Share

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...

Share

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

Share