praveen
BAN USER
Questions (4)
Comments (10)
Reputation 485
- 7of 15 votes
AnswersWAP to modify the array such that arr[I] = arr[arr[I]].
- praveen in United States
Do this in place i.e. with out using additional memory.
example : if a = {2,3,1,0}
o/p = a = {1,0,3,2}
Note : The array contains 0 to n-1 integers.| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer Algorithm - 0of 0 votes
AnswersYou have a vending machine with some inventory. write a program to help vending machine tender exact change to the customer.
- praveen in United States for Bing-Appex| Report Duplicate | Flag | PURGE
Microsoft Intern - 0of 0 votes
AnswersFind successor in a BST with duplicate values allowed.
- praveen in United States for Bing-Appex| Report Duplicate | Flag | PURGE
Microsoft Intern - 1of 1 vote
AnswersReverse Linked list in parts iteratively.
- praveen in United States for Bing-Appex
ex 1->2->3->4->5->6->7->8 and if 'parts' is 3.
o/p = 3->2->1->6->5->4->8->7.| Report Duplicate | Flag | PURGE
Microsoft Intern
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Ok this works for smaller numbers may be, how about larger numbers.
- praveen February 28, 2014Lets say we want to do this using 'byte' data type and there are numbers from 0 to 127. Would this still work ? nevertheless a vry nice approach.