## Print Stack Elements from Bottom to Top

Given a stack s, the task is to print the elements of the stack from bottom to top, such that the elements are still present… Read More »

- How can one become good at Data structures and Algorithms easily?
- Find maximum in a stack in O(1) time and O(1) extra space
- Cracking Technical Interviews
- Print the nodes of binary tree as they become the leaf node
- Reach the numbers by making jumps of two given lengths
- Lower and Upper Bound Theory
- Shannon-Fano Algorithm for Data Compression
- Rearrange Odd and Even values in Alternate Fashion in Ascending Order
- Dijkstra's shortest path with minimum edges
- Sort the array of strings according to alphabetical order defined by another string
- Sum of similarities of string with all of its suffixes
- How to write a Pseudo Code?
- Check if it is possible to reach a number by making jumps of two given length
- Code Optimization Technique (logical AND and logical OR)
- Dividing a Large file into Separate Modules in C/C++, Java and Python
- Find the number in a range having maximum product of the digits
- Smallest power of 2 which is greater than or equal to sum of array elements
- Iterative Letter Combinations of a Phone Number
- Ternary Search
- Program to print the Zigzag pattern
- Merge K sorted arrays | Set 3 ( Using Divide and Conquer Approach )
- Largest perfect square number in an Array
- Length of the longest alternating subarray
- Smallest Pair Sum in an array
- Number of array elements derivable from D after performing certain operations
- Count distinct substrings that contain some characters at most k times
- Color N boxes using M colors such that K boxes have different color from the box on its left
- Jump Pointer Algorithm
- Choose atleast two elements from array such that their GCD is 1 and cost is minimum
- Find alphabet in a Matrix which has maximum number of stars around it

Given a stack s, the task is to print the elements of the stack from bottom to top, such that the elements are still present… Read More »

Given two strings A and B of equal size. Two strings are equivalent either of the following conditions hold true: 1) They both are equal.… Read More »

Given a number N. The task is to count the number of prime numbers from 2 to N that can be expressed as a sum… Read More »

Given three positive integers A, B and C. The task is to find the maximum integer X > 0 such that: X % C =… Read More »

Given an array consisting of N positive integers, find the sum of bit-wise and of all possible sub-arrays of the array. Examples: Input : arr[]… Read More »

Given an array containing N positive integers, the task is to find the sum of XOR of all sub-arrays of the array. Examples: Input :… Read More »

Given an array of N elements, the task is to find the longest subarray which is Fibonacci-like. A Fibonacci-like sub-array is defined as an array… Read More »

Given two integers N and K, the task is to find a permutation of first 2*N natural numbers such that the following equation is satisfied.… Read More »

Given an array of N elements and Q queries, where each query contains an integer K. For each query, the task is to find the… Read More »

Given an N-ary tree T of N nodes, the task is to calculate the longest path between any two nodes(also known as the diameter of… Read More »

Given an array arr[] of integers and an integer pos, the task is to find the minimum index i such that all the elements from… Read More »

Given a number N, the task is to find a positive number M such that gcd(N^M, N&M) is the maximum possible and M < N.… Read More »

Given a singly linked list, remove all the nodes which have a greater value on the right side. Examples: a) The list 12->15->10->11->5->6->2->3->NULL should be… Read More »

Given the source point and the destination point of the path and two integers x and y. The task is to check whether it is… Read More »

Given an array consisting of even number of elements, the task is to divide the array into M group of elements (every group must contain… Read More »