[algogeeks] yahoo question

2011-09-21 Thread abhishek
You have given a number 123456789 and two opearators + and *. You can use this two operators as many times u want. But you cant change the sequence of the number given there. The evaluated value is 2097. e.g. 1+2+345*6+7+8+9=2097 You have to find all the such expressions that evaluates and

Re: [algogeeks] yahoo question

2011-09-21 Thread Simran Singh
Hey.. Which college you from..?? And please do tell more about their process.. On Wed, Sep 21, 2011 at 7:31 PM, abhishek abhishek.ma...@gmail.com wrote: You have given a number 123456789 and two opearators + and *. You can use this two operators as many times u want. But you cant change the

Re: [algogeeks] yahoo question

2011-09-21 Thread shady
@simran you interested in solving problem or knowing the company recruitment process :P @abhishek looks like a dynamic programming problem one simple brute force solution will be to go recursively down and evaluate all expressions one by one On Wed, Sep 21, 2011 at 8:22 PM, Simran Singh

[algogeeks] Yahoo Question

2011-07-10 Thread aanchal goyal
These are the various ways to swap 2 variables a) Using temporary Variable b) Usnig some Arithmentic operation c) Using bitwise XOR operation Explain which operation is better and Why? What if we need to swap -ive as well as floating point numbers also. -- Regards,* Aanchal Goyal*. -- You

Re: [algogeeks] Yahoo Question

2011-07-10 Thread vaibhav shukla
On Mon, Jul 11, 2011 at 1:51 AM, aanchal goyal goyal.aanch...@gmail.comwrote: These are the various ways to swap 2 variables a) Using temporary Variable always inefficient. using extra memory. b) Usnig some Arithmentic operation works for all numbers even floating points

[algogeeks] Yahoo!!!! Question Orkut.....tough One

2010-09-17 Thread bittu
if you click on any orkut member's name you will notice the relationship graph for both of you indicating through whom you are interconnected or in certain cases you won't get this path. if you have to propose algorithm what would be the one ... breadth first or depth first traversal with some

Re: [algogeeks] Yahoo!!!! Question Orkut.....tough One

2010-09-17 Thread saurabh singh
u need to find out the subset of connections associated with ur profile and that person's profile. using hashtable the problem will be solved.. On Sat, Sep 18, 2010 at 2:44 AM, bittu shashank7andr...@gmail.com wrote: if you click on any orkut member's name you will notice the relationship

[algogeeks] Yahoo Question

2010-09-15 Thread bittu
You are given k sorted lists with total n inputs in all the lists devise a algorithm to merge them into one single sorted list in O(n logk) Regard's Shashank Mani Narayan Don't Be Evil U Can Earn While U learn Computer Science Engineering Birla Institute of Technology,Mesra Cell No.

Re: [algogeeks] Yahoo Question

2010-09-15 Thread Rahul Singal
1. Take single element from each list . Put it in array maintaining min heap property , 2. Copy the lowest element ( O(1) ) from the heap to the single sorted list thand delete the element from heap. 3. Insert a new element into the heap ( O(logk) ) from list belonging to the deleted element . 4.

Re: [algogeeks] Yahoo Question

2010-09-15 Thread Chonku
Use k way merging On Wed, Sep 15, 2010 at 3:30 PM, bittu shashank7andr...@gmail.com wrote: You are given k sorted lists with total n inputs in all the lists devise a algorithm to merge them into one single sorted list in O(n logk) Regard's Shashank Mani Narayan Don't Be Evil U Can Earn

Re: [algogeeks] Yahoo Question

2010-09-15 Thread ankur aggarwal
use heap.. k node min / max heap. On Wed, Sep 15, 2010 at 3:30 PM, bittu shashank7andr...@gmail.com wrote: You are given k sorted lists with total n inputs in all the lists devise a algorithm to merge them into one single sorted list in O(n logk) Regard's Shashank Mani Narayan Don't Be