Topic — Add New » Posts Last Poster Freshness
To find the smalest positive no missing from an unsorted array 1 eGeek 6 hours

You are given an unsorted array with both positive and negative elements. You have to find the smallest positive number missing from the array in O(n) time using constant extra space.
Eg:
Input = {2, 3, 7, 6, 8, -1, -10, 15}
Outp...

Assignment operator overloading 1 Guddu Sharma 8 hours

When an object is made behave like an object as: *object=10
It is broken down by compiler as: object.operator*=10. Question was that whether it gets further decomposed as: (object.operator*).operator=(10)

I overloaded assi...

SEGMENTATION 2 kartik 16 hours

Can anybody explain segmentation????

Find 2 numbers with odd occurences 3 kartik 1 day

We have an array which contains integer numbers (not any fixed range). Only two numbers are repeated odd number of times and remaining even number of times. Find the 2 numbers.

Interview question 3 Venki 1 day

To number the pages of a book, the printer used 2989 digits. How many pages did the book have?

a)102 b)515 c)1024 d)2023

Google interview question 5 gautam5669 4 hours

Given two BST print the element in sorted form

complexity O(n) time maxm alloted space will be O(height of bigger tree)

eg ;

T1
     3
1       5

T2

    4
2       6

o/p 1 2 3 4 5 6

puzzle 1 sresta 3 days

write a program in which printf print -1 ......when printf executes sucessfully den it returns positive value.....same as.. if printf doesn't execute successfullyden it prints -1 ..when?

Getting kth smallest element 1 Guddu Sharma 4 days

Find the kth smallest element in an unsorted array.
My approach is the modified partitioning algorithm done during quick sort.
Here is the code which is working correctly. Please help me out getting the time complexity of the code..

Facebook Interview Question 2 asm 5 days

You are given an integer N and an integer M. You are supposed to write a method void findBestCoinsThatMinimizeAverage(int N, int M) that prints the best collection of N coins that minimize the average number of minimum coins needed to generate val...

MS interview question 2 geek4u 1 week

Given a list of words and a dictionary with many words. The dictionary may or may not include the the given list of words. From the given list of words,you need to print only those words which are present in dictionary.
Mention time complexi...

MS interview question 1 freakCoder 1 week

Given a set of numbers from 1 to n^2, generate subsets consisting of n numbers such that each subset has one and only one matching number from any other subset

The max number of sub-sets is n squared + n

An example is as follows:

[closed] Google Interview Question 3 geeksforgeeks 1 week

Given an array having positive integers, find a continous subarray which adds to a given number.

tree to file 1 Dheeraj 1 week

function to write a tree to file and another function to read tree from file.

LIS in nlogn time 2 kartik 1 week

How to solve the longest increasing subsequence problem in nlogn time?

Count internal nodes in a binary tree 2 kartik 1 week

how to count internal nodes in a binary tree?

Testing of factorial of a number 3 akshayjohri 1 week

Given a simple program designed to take inputs of integers from 1-1000 and to output the factorial value of that number, how would you test this program? You do not have access to the code. Please be as specific as possible

FB interview question 4 akshayjohri 1 week

Given a function bool Zoo(int x) and its called for y times , how you will generate the true with probability x/y times .
lest say if x = 65 & y=100, how will you generate true with probability 65/100. You can represent true by 1 and fal...