Java Program For Adding Two Numbers Represented By Linked Lists- Set 2
Given two numbers represented by two linked lists, write a function that returns the sum list. The sum list is linked list representation of the addition of two input numbers. It is not allowed to modify the lists. Also, not allowed to use explicit extra space (Hint: Use Recursion)....
read more
Find minimum number of coins to make a given value (Coin Change)
Given an array coins[] of size N and a target value V, where coins[i] represents the coins of different denominations. You have an infinite supply of each of coins. The task is to find minimum number of coins required to make the given value V. If it’s not possible to make a change, print -1....
read more
Counting Sort – Data Structures and Algorithms Tutorials
Counting Sort is a non-comparison-based sorting algorithm that works well when there is limited range of input values. It is particularly efficient when the range of input values is small compared to the number of elements to be sorted. The basic idea behind Counting Sort is to count the frequency of each distinct element in the input array and use that information to place the elements in their correct sorted positions....
read more
Count all combinations of coins to make a given value sum (Coin Change II)
Given an integer array of coins[ ] of size N representing different types of denominations and an integer sum, the task is to count all combinations of coins to make a given value sum....
read more
Next Greater Element (NGE) for every element in given Array
Given an array, print the Next Greater Element (NGE) for every element....
read more
Snapdeal Interview Experience
Round 1:...
read more
Climbing Stairs to reach at the top.
There are n stairs, a person standing at the bottom wants to climb stairs to reach the nth stair. The person can climb either 1 stair or 2 stairs at a time, the task is to count the number of ways that a person can reach at the top....
read more
Largest Rectangular Area in a Histogram using Stack
Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars whose heights are given in an array. For simplicity, assume that all bars have the same width and the width is 1 unit....
read more
Reverse a Linked List in groups of given size
Given a linked list, write a function to reverse every k nodes (where k is an input to the function)....
read more
Diameter of a Binary Tree
The diameter/width of a tree is defined as the number of nodes on the longest path between two end nodes....
read more
Snapdeal Interview Experience | Set 16 (Off-Campus for Software Development Engineer)
I had interview at Snapdeal Gurgaon for Software Development Engineer, before that I have also completed online test from home. I am 2016 passed out but having 2 years of working experience....
read more
C Program for Search an element in a sorted and rotated array
An element in a sorted array can be found in O(log n) time via binary search. But suppose we rotate an ascending order sorted array at some pivot unknown to you beforehand. So for instance, 1 2 3 4 5 might become 3 4 5 1 2. Devise a way to find an element in the rotated array in O(log n) time....
read more