You are given a circular single linked list of sufficiently many number of nodes(say more than 1 crore). You need to delete a node say P and you are given a pointer to P in the circular single list. Suggest the most efficient methodology of deleting the node P from the circular single linked list without rounding about the circular single linked list.
Write a C Program to reverse a stack "in place" using recursion ? You can only use the following ADT functions on Stack: IsEmpty IsFull Push Pop Top
You are provided with two stacks, and pop() and push() functions for them. You have to implement queue i.e. enqueue() and dequeue() using the available operations.
How do you reverse the words in a string? "My name is Amit Agarwal" to "Agarwal Amit is name My" A O(n) and 'in space' solution is appreciable.
You are given a sequence of numbers from 1 to n-1 with one of the numbers repeating only once. (example: 1 2 3 3 4 5). * How can you find the repeating number? * What if i give you the constraint that you can't use a dynamic amount of memory (i.e. the amount of memory you use can't be related to n)? * What if there are two repeating numbers,instead of one (and the same memory constraint?)
Given an array of numbers, except for one number all the others, occur twice. Give an algorithm to find that number which occurs only once in the array.
There is a series of numbers in ascending order. All these numbers have the same number of binary 1s in them. Given the number of 1 bits set in the numbers, write an algorithm/C program to find the nth number in the series.