Re: [algogeeks] Re: Yahoo
u can use any lang . perl python etc . On Thu, Sep 29, 2011 at 10:57 AM, prasanth n nprasnt...@gmail.com wrote: c++ and java ll be given more preference On Mon, Sep 26, 2011 at 5:59 PM, abhishek abhishek.ma...@gmail.comwrote: c,c++ ,java On Sep 26, 4:15 pm, Akash Mukherjee akash...@gmail.com wrote: any language pref?? are bash solns acceptable?? On Mon, Sep 26, 2011 at 12:04 PM, abhishek abhishek.ma...@gmail.com wrote: a file is given containing lots of records seprated by new line (records can be repeat) and a substring given for egabc now check for the record which contains the substring and print top 10 record according to their frequency derive algo with complexity o(n) On Sep 26, 10:58 am, htross htb...@gmail.com wrote: can u explain more on the coding question u solved? On Sep 26, 9:08 am, aditya kumar aditya.kumar130...@gmail.com wrote: I cleared the written round, the next round was coding round. We were asked to select any one problem out of three in 2 hrs. Q1) Given n number of xml files find a particular word and output should list all the files in current directory that contains that word. Q2) Given a hierarichal structure i.e., you have a parent class, a child class which extends a parent class which has some attributes and methods. You need to parse the structure and output should give you the set of the base class, set of derived class, set of attribute set and the set of method. Q3) Input - India is a great country. Key(alphanumeric) - B2. You have to encrypt the given sentence, in such a way that only the words should be jumbled. Output - great India a is country. While decrypting it, you have to use the same alpha numeric key and we should be able to get the same original string, i.e., India is a great country. I opted for the 3rd question, I used an array to store the starting offset of a word and i used key to shuffle the offset. i used hash function which takes the key and according the key value it shuffles the set of offsets while doing encryption. While decrypting i used the reverse method and i shuffled the same way to get back the original offset. After 2 hrs the external asked me to explain my logic, i explained each and every line and he was very much happy with the algorithm. He asked all the students to wait outside. They shortly announced the results for the next interview round. Technical round -1 He asked me whether i was nervous, i told him frankly, yes sir a little bit. Then he motivated me by saying that you have done well in the previous rounds thats why you are here. Then he asked me to solve a problem. The problem was given a time in format of hh:mm we have to find the min angle between hr nd min hand. I answered him well and he was happy with that so he did not aske me to write the code. Second question - There is a system which continuously takes stream of data from one end, and from other end we want to retrive the particualr number is present in the system or not. Example - If you are retriving for 10 and if it is present then return the same number else return the closest value to that number. I used hashing then he asked me if I had a large input let us say in lakhs then hashing is not ideal approach. Then i told him that its better to use max heap. Then he said ok and before moving to next questions he told me that there are other better approach to this. He asked about my favourite subjects since i told my fav subject was OS, he started askimg me questions about OS. The questions were -Difference b/w semaphore and monitor -There are two threads, one produces even number and other produces odd number, how will you print the consecutive numbers. -What is semaphore and how will you implement it? -What is deadlock and what are 4 conditions of deadlock. -Simulate deadlock(Pictorial diagram). -Which data structure will you use for deadlock? I answered all the above questions so he was very much happy with it. Then and there he told me that i wont eliminate you in this round and would like to see you in next round. Technical round-2 He asked me about my previous round experience and asked me to introduce myself for another 2/3 mins. He gave me a problem, there is a function which returns 0 or 1. You need to pass each and every element of the array one by one to that function and depending on the return value, you need to store all the numbers in such a way that all the true values should
[algogeeks] Re: Yahoo
a file is given containing lots of records seprated by new line (records can be repeat) and a substring given for egabc now check for the record which contains the substring and print top 10 record according to their frequency derive algo with complexity o(n) On Sep 26, 10:58 am, htross htb...@gmail.com wrote: can u explain more on the coding question u solved? On Sep 26, 9:08 am, aditya kumar aditya.kumar130...@gmail.com wrote: I cleared the written round, the next round was coding round. We were asked to select any one problem out of three in 2 hrs. Q1) Given n number of xml files find a particular word and output should list all the files in current directory that contains that word. Q2) Given a hierarichal structure i.e., you have a parent class, a child class which extends a parent class which has some attributes and methods. You need to parse the structure and output should give you the set of the base class, set of derived class, set of attribute set and the set of method. Q3) Input - India is a great country. Key(alphanumeric) - B2. You have to encrypt the given sentence, in such a way that only the words should be jumbled. Output - great India a is country. While decrypting it, you have to use the same alpha numeric key and we should be able to get the same original string, i.e., India is a great country. I opted for the 3rd question, I used an array to store the starting offset of a word and i used key to shuffle the offset. i used hash function which takes the key and according the key value it shuffles the set of offsets while doing encryption. While decrypting i used the reverse method and i shuffled the same way to get back the original offset. After 2 hrs the external asked me to explain my logic, i explained each and every line and he was very much happy with the algorithm. He asked all the students to wait outside. They shortly announced the results for the next interview round. Technical round -1 He asked me whether i was nervous, i told him frankly, yes sir a little bit. Then he motivated me by saying that you have done well in the previous rounds thats why you are here. Then he asked me to solve a problem. The problem was given a time in format of hh:mm we have to find the min angle between hr nd min hand. I answered him well and he was happy with that so he did not aske me to write the code. Second question - There is a system which continuously takes stream of data from one end, and from other end we want to retrive the particualr number is present in the system or not. Example - If you are retriving for 10 and if it is present then return the same number else return the closest value to that number. I used hashing then he asked me if I had a large input let us say in lakhs then hashing is not ideal approach. Then i told him that its better to use max heap. Then he said ok and before moving to next questions he told me that there are other better approach to this. He asked about my favourite subjects since i told my fav subject was OS, he started askimg me questions about OS. The questions were -Difference b/w semaphore and monitor -There are two threads, one produces even number and other produces odd number, how will you print the consecutive numbers. -What is semaphore and how will you implement it? -What is deadlock and what are 4 conditions of deadlock. -Simulate deadlock(Pictorial diagram). -Which data structure will you use for deadlock? I answered all the above questions so he was very much happy with it. Then and there he told me that i wont eliminate you in this round and would like to see you in next round. Technical round-2 He asked me about my previous round experience and asked me to introduce myself for another 2/3 mins. He gave me a problem, there is a function which returns 0 or 1. You need to pass each and every element of the array one by one to that function and depending on the return value, you need to store all the numbers in such a way that all the true values should appear first and all the false value should appear last. After thinking for some time i came up with O(n) solution, he asked me to future optimze it. Within 2 mins he moved on to next question. Next question was a puzzle about aliens. Third question was about the real life example of stack. Fourth question was how the internet works as i told that OS and networking was my strong subject. Fifth question was how will you implement tree in real life example. He asked me to wait outside for the result. I got elimiated in that round and the next was HR round. On Sun, Sep 25, 2011 at 9:06 PM, Aditya Virmani virmanisadi...@gmail.comwrote: neone who has appeared for yahoo recently? can ne one mention thr i/w / written rounds experience; they visited dce 3 days back also nit
Re: [algogeeks] Re: Yahoo
any language pref?? are bash solns acceptable?? On Mon, Sep 26, 2011 at 12:04 PM, abhishek abhishek.ma...@gmail.com wrote: a file is given containing lots of records seprated by new line (records can be repeat) and a substring given for egabc now check for the record which contains the substring and print top 10 record according to their frequency derive algo with complexity o(n) On Sep 26, 10:58 am, htross htb...@gmail.com wrote: can u explain more on the coding question u solved? On Sep 26, 9:08 am, aditya kumar aditya.kumar130...@gmail.com wrote: I cleared the written round, the next round was coding round. We were asked to select any one problem out of three in 2 hrs. Q1) Given n number of xml files find a particular word and output should list all the files in current directory that contains that word. Q2) Given a hierarichal structure i.e., you have a parent class, a child class which extends a parent class which has some attributes and methods. You need to parse the structure and output should give you the set of the base class, set of derived class, set of attribute set and the set of method. Q3) Input - India is a great country. Key(alphanumeric) - B2. You have to encrypt the given sentence, in such a way that only the words should be jumbled. Output - great India a is country. While decrypting it, you have to use the same alpha numeric key and we should be able to get the same original string, i.e., India is a great country. I opted for the 3rd question, I used an array to store the starting offset of a word and i used key to shuffle the offset. i used hash function which takes the key and according the key value it shuffles the set of offsets while doing encryption. While decrypting i used the reverse method and i shuffled the same way to get back the original offset. After 2 hrs the external asked me to explain my logic, i explained each and every line and he was very much happy with the algorithm. He asked all the students to wait outside. They shortly announced the results for the next interview round. Technical round -1 He asked me whether i was nervous, i told him frankly, yes sir a little bit. Then he motivated me by saying that you have done well in the previous rounds thats why you are here. Then he asked me to solve a problem. The problem was given a time in format of hh:mm we have to find the min angle between hr nd min hand. I answered him well and he was happy with that so he did not aske me to write the code. Second question - There is a system which continuously takes stream of data from one end, and from other end we want to retrive the particualr number is present in the system or not. Example - If you are retriving for 10 and if it is present then return the same number else return the closest value to that number. I used hashing then he asked me if I had a large input let us say in lakhs then hashing is not ideal approach. Then i told him that its better to use max heap. Then he said ok and before moving to next questions he told me that there are other better approach to this. He asked about my favourite subjects since i told my fav subject was OS, he started askimg me questions about OS. The questions were -Difference b/w semaphore and monitor -There are two threads, one produces even number and other produces odd number, how will you print the consecutive numbers. -What is semaphore and how will you implement it? -What is deadlock and what are 4 conditions of deadlock. -Simulate deadlock(Pictorial diagram). -Which data structure will you use for deadlock? I answered all the above questions so he was very much happy with it. Then and there he told me that i wont eliminate you in this round and would like to see you in next round. Technical round-2 He asked me about my previous round experience and asked me to introduce myself for another 2/3 mins. He gave me a problem, there is a function which returns 0 or 1. You need to pass each and every element of the array one by one to that function and depending on the return value, you need to store all the numbers in such a way that all the true values should appear first and all the false value should appear last. After thinking for some time i came up with O(n) solution, he asked me to future optimze it. Within 2 mins he moved on to next question. Next question was a puzzle about aliens. Third question was about the real life example of stack. Fourth question was how the internet works as i told that OS and networking was my strong subject. Fifth question was how will you implement tree in real life example. He asked me to wait outside for the result. I
[algogeeks] Re: Yahoo
c,c++ ,java On Sep 26, 4:15 pm, Akash Mukherjee akash...@gmail.com wrote: any language pref?? are bash solns acceptable?? On Mon, Sep 26, 2011 at 12:04 PM, abhishek abhishek.ma...@gmail.com wrote: a file is given containing lots of records seprated by new line (records can be repeat) and a substring given for egabc now check for the record which contains the substring and print top 10 record according to their frequency derive algo with complexity o(n) On Sep 26, 10:58 am, htross htb...@gmail.com wrote: can u explain more on the coding question u solved? On Sep 26, 9:08 am, aditya kumar aditya.kumar130...@gmail.com wrote: I cleared the written round, the next round was coding round. We were asked to select any one problem out of three in 2 hrs. Q1) Given n number of xml files find a particular word and output should list all the files in current directory that contains that word. Q2) Given a hierarichal structure i.e., you have a parent class, a child class which extends a parent class which has some attributes and methods. You need to parse the structure and output should give you the set of the base class, set of derived class, set of attribute set and the set of method. Q3) Input - India is a great country. Key(alphanumeric) - B2. You have to encrypt the given sentence, in such a way that only the words should be jumbled. Output - great India a is country. While decrypting it, you have to use the same alpha numeric key and we should be able to get the same original string, i.e., India is a great country. I opted for the 3rd question, I used an array to store the starting offset of a word and i used key to shuffle the offset. i used hash function which takes the key and according the key value it shuffles the set of offsets while doing encryption. While decrypting i used the reverse method and i shuffled the same way to get back the original offset. After 2 hrs the external asked me to explain my logic, i explained each and every line and he was very much happy with the algorithm. He asked all the students to wait outside. They shortly announced the results for the next interview round. Technical round -1 He asked me whether i was nervous, i told him frankly, yes sir a little bit. Then he motivated me by saying that you have done well in the previous rounds thats why you are here. Then he asked me to solve a problem. The problem was given a time in format of hh:mm we have to find the min angle between hr nd min hand. I answered him well and he was happy with that so he did not aske me to write the code. Second question - There is a system which continuously takes stream of data from one end, and from other end we want to retrive the particualr number is present in the system or not. Example - If you are retriving for 10 and if it is present then return the same number else return the closest value to that number. I used hashing then he asked me if I had a large input let us say in lakhs then hashing is not ideal approach. Then i told him that its better to use max heap. Then he said ok and before moving to next questions he told me that there are other better approach to this. He asked about my favourite subjects since i told my fav subject was OS, he started askimg me questions about OS. The questions were -Difference b/w semaphore and monitor -There are two threads, one produces even number and other produces odd number, how will you print the consecutive numbers. -What is semaphore and how will you implement it? -What is deadlock and what are 4 conditions of deadlock. -Simulate deadlock(Pictorial diagram). -Which data structure will you use for deadlock? I answered all the above questions so he was very much happy with it. Then and there he told me that i wont eliminate you in this round and would like to see you in next round. Technical round-2 He asked me about my previous round experience and asked me to introduce myself for another 2/3 mins. He gave me a problem, there is a function which returns 0 or 1. You need to pass each and every element of the array one by one to that function and depending on the return value, you need to store all the numbers in such a way that all the true values should appear first and all the false value should appear last. After thinking for some time i came up with O(n) solution, he asked me to future optimze it. Within 2 mins he moved on to next question. Next question was a puzzle about aliens. Third question was about the real life example of stack. Fourth question was how the internet works as i told that OS and networking was my
[algogeeks] Re: Yahoo! visit
here is the process of paypal/ebay india written test ---40 ques in 60 min (no negative marking) interview 1 interview 2 HR interview written was a mix of technical and aptitude question interview 1 first asked me about my hobby and discussed about 5 to 10 min on it discussed on project asked me to draw some diagrams related to project and asked to implement the class patient (as my project was hospital management system) then question on traversing the link list interview 2 asked 3 puzzle on time and distance friend class concept reversing a string without using any temporary variable a question on link list from the written test and there was no HR interview for me BTW this was just formality they were checking comm skill and willingness to join On Sep 23, 7:17 pm, vartika aggarwal vartika.aggarwa...@gmail.com wrote: If anyone has any idea about the process of Ebay and/or Yahoo! (especially the questions asked), kindly post it here soon...it's visiting our campus on Sunday.. Please help! -- Regards Vartika Aggarwal Undergraduate Student IT Department NSIT, Dwarka -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Yahoo
process was written test technical interview 1 tech interview 2 coading round disscussion /improvement in coading On Sep 26, 9:08 am, aditya kumar aditya.kumar130...@gmail.com wrote: I cleared the written round, the next round was coding round. We were asked to select any one problem out of three in 2 hrs. Q1) Given n number of xml files find a particular word and output should list all the files in current directory that contains that word. Q2) Given a hierarichal structure i.e., you have a parent class, a child class which extends a parent class which has some attributes and methods. You need to parse the structure and output should give you the set of the base class, set of derived class, set of attribute set and the set of method. Q3) Input - India is a great country. Key(alphanumeric) - B2. You have to encrypt the given sentence, in such a way that only the words should be jumbled. Output - great India a is country. While decrypting it, you have to use the same alpha numeric key and we should be able to get the same original string, i.e., India is a great country. I opted for the 3rd question, I used an array to store the starting offset of a word and i used key to shuffle the offset. i used hash function which takes the key and according the key value it shuffles the set of offsets while doing encryption. While decrypting i used the reverse method and i shuffled the same way to get back the original offset. After 2 hrs the external asked me to explain my logic, i explained each and every line and he was very much happy with the algorithm. He asked all the students to wait outside. They shortly announced the results for the next interview round. Technical round -1 He asked me whether i was nervous, i told him frankly, yes sir a little bit. Then he motivated me by saying that you have done well in the previous rounds thats why you are here. Then he asked me to solve a problem. The problem was given a time in format of hh:mm we have to find the min angle between hr nd min hand. I answered him well and he was happy with that so he did not aske me to write the code. Second question - There is a system which continuously takes stream of data from one end, and from other end we want to retrive the particualr number is present in the system or not. Example - If you are retriving for 10 and if it is present then return the same number else return the closest value to that number. I used hashing then he asked me if I had a large input let us say in lakhs then hashing is not ideal approach. Then i told him that its better to use max heap. Then he said ok and before moving to next questions he told me that there are other better approach to this. He asked about my favourite subjects since i told my fav subject was OS, he started askimg me questions about OS. The questions were -Difference b/w semaphore and monitor -There are two threads, one produces even number and other produces odd number, how will you print the consecutive numbers. -What is semaphore and how will you implement it? -What is deadlock and what are 4 conditions of deadlock. -Simulate deadlock(Pictorial diagram). -Which data structure will you use for deadlock? I answered all the above questions so he was very much happy with it. Then and there he told me that i wont eliminate you in this round and would like to see you in next round. Technical round-2 He asked me about my previous round experience and asked me to introduce myself for another 2/3 mins. He gave me a problem, there is a function which returns 0 or 1. You need to pass each and every element of the array one by one to that function and depending on the return value, you need to store all the numbers in such a way that all the true values should appear first and all the false value should appear last. After thinking for some time i came up with O(n) solution, he asked me to future optimze it. Within 2 mins he moved on to next question. Next question was a puzzle about aliens. Third question was about the real life example of stack. Fourth question was how the internet works as i told that OS and networking was my strong subject. Fifth question was how will you implement tree in real life example. He asked me to wait outside for the result. I got elimiated in that round and the next was HR round. On Sun, Sep 25, 2011 at 9:06 PM, Aditya Virmani virmanisadi...@gmail.comwrote: neone who has appeared for yahoo recently? can ne one mention thr i/w / written rounds experience; they visited dce 3 days back also nit surathkal... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at
[algogeeks] Re: Yahoo
can u explain more on the coding question u solved? On Sep 26, 9:08 am, aditya kumar aditya.kumar130...@gmail.com wrote: I cleared the written round, the next round was coding round. We were asked to select any one problem out of three in 2 hrs. Q1) Given n number of xml files find a particular word and output should list all the files in current directory that contains that word. Q2) Given a hierarichal structure i.e., you have a parent class, a child class which extends a parent class which has some attributes and methods. You need to parse the structure and output should give you the set of the base class, set of derived class, set of attribute set and the set of method. Q3) Input - India is a great country. Key(alphanumeric) - B2. You have to encrypt the given sentence, in such a way that only the words should be jumbled. Output - great India a is country. While decrypting it, you have to use the same alpha numeric key and we should be able to get the same original string, i.e., India is a great country. I opted for the 3rd question, I used an array to store the starting offset of a word and i used key to shuffle the offset. i used hash function which takes the key and according the key value it shuffles the set of offsets while doing encryption. While decrypting i used the reverse method and i shuffled the same way to get back the original offset. After 2 hrs the external asked me to explain my logic, i explained each and every line and he was very much happy with the algorithm. He asked all the students to wait outside. They shortly announced the results for the next interview round. Technical round -1 He asked me whether i was nervous, i told him frankly, yes sir a little bit. Then he motivated me by saying that you have done well in the previous rounds thats why you are here. Then he asked me to solve a problem. The problem was given a time in format of hh:mm we have to find the min angle between hr nd min hand. I answered him well and he was happy with that so he did not aske me to write the code. Second question - There is a system which continuously takes stream of data from one end, and from other end we want to retrive the particualr number is present in the system or not. Example - If you are retriving for 10 and if it is present then return the same number else return the closest value to that number. I used hashing then he asked me if I had a large input let us say in lakhs then hashing is not ideal approach. Then i told him that its better to use max heap. Then he said ok and before moving to next questions he told me that there are other better approach to this. He asked about my favourite subjects since i told my fav subject was OS, he started askimg me questions about OS. The questions were -Difference b/w semaphore and monitor -There are two threads, one produces even number and other produces odd number, how will you print the consecutive numbers. -What is semaphore and how will you implement it? -What is deadlock and what are 4 conditions of deadlock. -Simulate deadlock(Pictorial diagram). -Which data structure will you use for deadlock? I answered all the above questions so he was very much happy with it. Then and there he told me that i wont eliminate you in this round and would like to see you in next round. Technical round-2 He asked me about my previous round experience and asked me to introduce myself for another 2/3 mins. He gave me a problem, there is a function which returns 0 or 1. You need to pass each and every element of the array one by one to that function and depending on the return value, you need to store all the numbers in such a way that all the true values should appear first and all the false value should appear last. After thinking for some time i came up with O(n) solution, he asked me to future optimze it. Within 2 mins he moved on to next question. Next question was a puzzle about aliens. Third question was about the real life example of stack. Fourth question was how the internet works as i told that OS and networking was my strong subject. Fifth question was how will you implement tree in real life example. He asked me to wait outside for the result. I got elimiated in that round and the next was HR round. On Sun, Sep 25, 2011 at 9:06 PM, Aditya Virmani virmanisadi...@gmail.comwrote: neone who has appeared for yahoo recently? can ne one mention thr i/w / written rounds experience; they visited dce 3 days back also nit surathkal... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because
[algogeeks] Re: yahoo question
DCE i am also want to know recruitment process as it is coming on 23rd. On Sep 21, 7:52 pm, Simran Singh sammy.4...@gmail.com wrote: 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 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 value is equal to the given value. You can use concatenation of numbers like 345 is concatenated there. Please remember that You have to find all Such expressions. And write C/C++/Java code for that -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Simran Singh Under Graduate student, Computer Engineering, Netaji Subhas Institute Of Technology, Dwarka Sec-3, Delhi-78 (M): +91-9811699512 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: yahoo question
http://stackoverflow.com/questions/4573744/modify-a-given-number-to-find-the-required-sum/4573881#4573881 for solution.. And please do share all the info you gather about the process.. On Wed, Sep 21, 2011 at 9:31 PM, abhishek abhishek.ma...@gmail.com wrote: DCE i am also want to know recruitment process as it is coming on 23rd. On Sep 21, 7:52 pm, Simran Singh sammy.4...@gmail.com wrote: 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 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 value is equal to the given value. You can use concatenation of numbers like 345 is concatenated there. Please remember that You have to find all Such expressions. And write C/C++/Java code for that -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Simran Singh Under Graduate student, Computer Engineering, Netaji Subhas Institute Of Technology, Dwarka Sec-3, Delhi-78 (M): +91-9811699512 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Simran Singh Under Graduate student, Computer Engineering, Netaji Subhas Institute Of Technology, Dwarka Sec-3, Delhi-78 (M): +91-9811699512 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: yahoo campus placements
http://in.careers.yahoo.com/students/content/186 check this .. it has visited many colleges including trichy NIT .. contact them...kindly share ur experience after attending ... On Sep 15, 8:09 am, Akash Mukherjee akash...@gmail.com wrote: k...bt its a gud 2 weeks lefti guess der wud be sm other clg visits b4 dat On Wed, Sep 14, 2011 at 9:22 PM, htross htb...@gmail.com wrote: please share the questions asked after the company visits ur campus On Sep 14, 8:53 pm, Akash Mukherjee akash...@gmail.com wrote: bit mesra, cg 7...dunno nething else :( On Wed, Sep 14, 2011 at 3:00 PM, rahul sharma rahul23111...@gmail.com wrote: in which col it is cumingn wats is its procedure???waht is cgpa creteria? On Wed, Sep 14, 2011 at 6:26 PM, Akash Mukherjee akash...@gmail.com wrote: anybody has any yahoo campus placements papers/questions or tips etc. please share thanx in advance Akash -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: yahoo campus placements
Check the link: http://www.careercup.com/page?pid=yahoo-interview-questions -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/2N_Nig__1foJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: yahoo campus placements
do share u experiences..n questions if possible 4 sure!!! thnx..in advance... Regards, PAYAL GUPTA, CSE-3rd yr NIT-B On Fri, Sep 16, 2011 at 11:31 AM, siva viknesh sivavikne...@gmail.comwrote: http://in.careers.yahoo.com/students/content/186 check this .. it has visited many colleges including trichy NIT .. contact them...kindly share ur experience after attending ... On Sep 15, 8:09 am, Akash Mukherjee akash...@gmail.com wrote: k...bt its a gud 2 weeks lefti guess der wud be sm other clg visits b4 dat On Wed, Sep 14, 2011 at 9:22 PM, htross htb...@gmail.com wrote: please share the questions asked after the company visits ur campus On Sep 14, 8:53 pm, Akash Mukherjee akash...@gmail.com wrote: bit mesra, cg 7...dunno nething else :( On Wed, Sep 14, 2011 at 3:00 PM, rahul sharma rahul23111...@gmail.com wrote: in which col it is cumingn wats is its procedure???waht is cgpa creteria? On Wed, Sep 14, 2011 at 6:26 PM, Akash Mukherjee akash...@gmail.com wrote: anybody has any yahoo campus placements papers/questions or tips etc. please share thanx in advance Akash -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: yahoo campus placements
please share the questions asked after the company visits ur campus On Sep 14, 8:53 pm, Akash Mukherjee akash...@gmail.com wrote: bit mesra, cg 7...dunno nething else :( On Wed, Sep 14, 2011 at 3:00 PM, rahul sharma rahul23111...@gmail.comwrote: in which col it is cumingn wats is its procedure???waht is cgpa creteria? On Wed, Sep 14, 2011 at 6:26 PM, Akash Mukherjee akash...@gmail.comwrote: anybody has any yahoo campus placements papers/questions or tips etc. please share thanx in advance Akash -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: yahoo campus placements
k...bt its a gud 2 weeks lefti guess der wud be sm other clg visits b4 dat On Wed, Sep 14, 2011 at 9:22 PM, htross htb...@gmail.com wrote: please share the questions asked after the company visits ur campus On Sep 14, 8:53 pm, Akash Mukherjee akash...@gmail.com wrote: bit mesra, cg 7...dunno nething else :( On Wed, Sep 14, 2011 at 3:00 PM, rahul sharma rahul23111...@gmail.com wrote: in which col it is cumingn wats is its procedure???waht is cgpa creteria? On Wed, Sep 14, 2011 at 6:26 PM, Akash Mukherjee akash...@gmail.com wrote: anybody has any yahoo campus placements papers/questions or tips etc. please share thanx in advance Akash -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: yahoo
its offering 9.55was there a coding round also On Sep 9, 4:19 pm, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: whch collg wat package? last time when it came to our collg..it has 4 questions on probablity..2-3 on c..and rest 15 20 on unix.. On Fri, Sep 9, 2011 at 3:40 PM, htross htb...@gmail.com wrote: hi everyone yahoo is coming to our college on september 30 what kind of questions will be asked in first round??? how to prepare for the first round -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Dheeraj Sharma* Comp Engg. NIT Kurukshetra +91 8950264227 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: yahoo
yeah..after that their was..one coding..round..and then interviews... i didnt gave the coding round..bt i know..that there was..coding round.. On Fri, Sep 9, 2011 at 5:15 PM, htross htb...@gmail.com wrote: its offering 9.55was there a coding round also On Sep 9, 4:19 pm, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: whch collg wat package? last time when it came to our collg..it has 4 questions on probablity..2-3 on c..and rest 15 20 on unix.. On Fri, Sep 9, 2011 at 3:40 PM, htross htb...@gmail.com wrote: hi everyone yahoo is coming to our college on september 30 what kind of questions will be asked in first round??? how to prepare for the first round -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Dheeraj Sharma* Comp Engg. NIT Kurukshetra +91 8950264227 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Dheeraj Sharma* Comp Engg. NIT Kurukshetra +91 8950264227 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: yahoo
please someone post wat question was asked in coding round. On Sep 9, 6:55 pm, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: yeah..after that their was..one coding..round..and then interviews... i didnt gave the coding round..bt i know..that there was..coding round.. On Fri, Sep 9, 2011 at 5:15 PM, htross htb...@gmail.com wrote: its offering 9.55was there a coding round also On Sep 9, 4:19 pm, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: whch collg wat package? last time when it came to our collg..it has 4 questions on probablity..2-3 on c..and rest 15 20 on unix.. On Fri, Sep 9, 2011 at 3:40 PM, htross htb...@gmail.com wrote: hi everyone yahoo is coming to our college on september 30 what kind of questions will be asked in first round??? how to prepare for the first round -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Dheeraj Sharma* Comp Engg. NIT Kurukshetra +91 8950264227 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Dheeraj Sharma* Comp Engg. NIT Kurukshetra +91 8950264227 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo Question
Can anyone give an insight into the way XOR operations are used for swapping two variables? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/ZJ_fiB6VmlQJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo Question
@abhi For XOR a=a^b; b=a^b; a=a^b; On Tue, Jul 12, 2011 at 4:26 PM, Abhi abhi123khat...@gmail.com wrote: Can anyone give an insight into the way XOR operations are used for swapping two variables? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/ZJ_fiB6VmlQJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Atul Purohit -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo Question
@vaibhav Overflow problem in case of big number in option b. the best and simple one is option a. Best Wishes Sachin Sharma | Software Trainee | Information Mosaic New York | Dublin | London | Luxembourg | New Delhi | Singapore | Melbourne | e-mail: sachinku...@informationmosaic.com Web:www.informationmosaic.comhttp://www.informationmosaic.com/ | t: www.twitter.com/infomosaic Winner 2009 Banking Technology Readers' Choice Award for Best Corporate Actions Automation Solution -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo Question
Option A: Works on all data types Option B: Works on numerical data, (best on integral data) but leads to overflow problem Option C: XOR would solve the problem of overflow, but afaik bitwise operators work on integral data Regards, Sandeep Jain On Mon, Jul 11, 2011 at 12:03 PM, sachin sharma sachin.bles...@gmail.comwrote: @vaibhav Overflow problem in case of big number in option b. the best and simple one is option a. Best Wishes Sachin Sharma | Software Trainee | Information Mosaic New York | Dublin | London | Luxembourg | New Delhi | Singapore | Melbourne | e-mail: sachinku...@informationmosaic.com Web:www.informationmosaic.comhttp://www.informationmosaic.com/ | t: www.twitter.com/infomosaic Winner 2009 Banking Technology Readers' Choice Award for Best Corporate Actions Automation Solution -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo Question
only first is conditionally independent and other options are used with some conditions thats why always first one is preferable. On Mon, Jul 11, 2011 at 12:03 PM, sachin sharma sachin.bles...@gmail.comwrote: @vaibhav Overflow problem in case of big number in option b. the best and simple one is option a. Best Wishes Sachin Sharma | Software Trainee | Information Mosaic New York | Dublin | London | Luxembourg | New Delhi | Singapore | Melbourne | e-mail: sachinku...@informationmosaic.com Web:www.informationmosaic.comhttp://www.informationmosaic.com/ | t: www.twitter.com/infomosaic Winner 2009 Banking Technology Readers' Choice Award for Best Corporate Actions Automation Solution -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Aditya Pratap MCA II -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo Question
thanks sandeep sir On Mon, Jul 11, 2011 at 12:16 PM, aditya pratap contacttoadity...@gmail.com wrote: only first is conditionally independent and other options are used with some conditions thats why always first one is preferable. On Mon, Jul 11, 2011 at 12:03 PM, sachin sharma sachin.bles...@gmail.comwrote: @vaibhav Overflow problem in case of big number in option b. the best and simple one is option a. Best Wishes Sachin Sharma | Software Trainee | Information Mosaic New York | Dublin | London | Luxembourg | New Delhi | Singapore | Melbourne | e-mail: sachinku...@informationmosaic.com Web:www.informationmosaic.comhttp://www.informationmosaic.com/ | t: www.twitter.com/infomosaic Winner 2009 Banking Technology Readers' Choice Award for Best Corporate Actions Automation Solution -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Aditya Pratap MCA II -- Regards Aditya Pratap MCA II -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo Question
1.using temporary variable method is the best as it is applicable to all datatype. 2.using airthmatic expresion:- problem arise if we r swap the value using pointer and both pointer point to same location let int *x and int *y both point to a=20; now we write a method swap void swap(int *x,int *y) { *x=*x+*y; //20+20=40 *y=*x-*y; //40-40=0; *x=*x-*y;// 0-0=0 } In this case this method fail since x and y both point to a=20;and result become 0; 3.same problem arise in bitwise xor opertor. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Yahoo Question
@Vaibhav: Your method b doesn't work for floating point numbers because they have finite precision. E.g.,as an extreme example, try it on a = 1 and b = 1d-25. When you form a+b, the result is 1, not 1 + 1d-25. Then 1 - 1d-25 gives 1 (which is correct), and 1 - 1 = 0. The latter should be 1d-25, so you have a total loss of precision in that number. More common would be just a partial loss of precision. Dave On Jul 10, 3:55 pm, vaibhav shukla vaibhav200...@gmail.com wrote: 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 a and b are two no. to swap : a=a+b; b=a-b; a=a-b; always works c) Using bitwise XOR operation since bitwise results an error in floating point numbers so this method also fails. hence (b) is better among the three.what say ? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- best wishes!! Vaibhav Shukla DU-MCA -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo Question
using a temp variable is considered to be the best option.. On 7/11/11, Dave dave_and_da...@juno.com wrote: @Vaibhav: Your method b doesn't work for floating point numbers because they have finite precision. E.g.,as an extreme example, try it on a = 1 and b = 1d-25. When you form a+b, the result is 1, not 1 + 1d-25. Then 1 - 1d-25 gives 1 (which is correct), and 1 - 1 = 0. The latter should be 1d-25, so you have a total loss of precision in that number. More common would be just a partial loss of precision. Dave On Jul 10, 3:55 pm, vaibhav shukla vaibhav200...@gmail.com wrote: 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 a and b are two no. to swap : a=a+b; b=a-b; a=a-b; always works c) Using bitwise XOR operation since bitwise results an error in floating point numbers so this method also fails. hence (b) is better among the three.what say ? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- best wishes!! Vaibhav Shukla DU-MCA -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Piyush Sinha* *IIIT, Allahabad* *+91-8792136657* *+91-7483122727* *https://www.facebook.com/profile.php?id=10655377926 * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo Question
Oh I got it. If ( interview at google) { Map reduce } else if(interview at yahoo) { Hadoop } else { Your personal preference. } On Thu, Jun 30, 2011 at 4:02 AM, bittu shashank7andr...@gmail.com wrote: 1.Use Haddop Map Reduce Framework .Obviously We Need Distributed Algo we will make one computer as master assign the job to all slave computer to do the crawling the web depending upon the geographic area ( m thinking real time problem).to crawled the maximum pages in least time we need above framework or any other distributed framework like google map reduce or GFS. computers are given for maximizing the crawling function minimizing the the crawling time time.. Algorithmically you ca think of its like a graph which has 100 connected components in it we will bfs to traverse each computer to find out the number of pages it has been crawled till now. i have given some overview hope it will help Thanks Shashank I Don't Do Code to Code But I Do Code to Build Product Computer Science Engineering Birla Institute of Technology,Mesra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- regards, chinna. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Yahoo Question
1.Use Haddop Map Reduce Framework .Obviously We Need Distributed Algo we will make one computer as master assign the job to all slave computer to do the crawling the web depending upon the geographic area ( m thinking real time problem).to crawled the maximum pages in least time we need above framework or any other distributed framework like google map reduce or GFS. computers are given for maximizing the crawling function minimizing the the crawling time time.. Algorithmically you ca think of its like a graph which has 100 connected components in it we will bfs to traverse each computer to find out the number of pages it has been crawled till now. i have given some overview hope it will help Thanks Shashank I Don't Do Code to Code But I Do Code to Build Product Computer Science Engineering Birla Institute of Technology,Mesra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo Question
lol... unfortunately i gave the same answer, and they told me to try my luck at google.. Regards, Priyanshu Gupta On Tue, Jun 28, 2011 at 10:42 AM, pacific :-) pacific4...@gmail.com wrote: Brin and Larry would be the best people to answer this question. On Tue, Jun 28, 2011 at 12:10 AM, priyanshu priyanshuro...@gmail.comwrote: anyone!!! On Jun 23, 3:28 pm, Priyanshu priyanshuro...@gmail.com wrote: You have 100 computers, connected with each other. Give the most efficient way to design a web crawler, which will crawl most pages in least amount of time. Thanks, Priyanshu. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- regards, chinna. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo Question
:)) On 28 June 2011 23:27, Priyanshu priyanshuro...@gmail.com wrote: lol... unfortunately i gave the same answer, and they told me to try my luck at google.. Regards, Priyanshu Gupta On Tue, Jun 28, 2011 at 10:42 AM, pacific :-) pacific4...@gmail.comwrote: Brin and Larry would be the best people to answer this question. On Tue, Jun 28, 2011 at 12:10 AM, priyanshu priyanshuro...@gmail.comwrote: anyone!!! On Jun 23, 3:28 pm, Priyanshu priyanshuro...@gmail.com wrote: You have 100 computers, connected with each other. Give the most efficient way to design a web crawler, which will crawl most pages in least amount of time. Thanks, Priyanshu. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- regards, chinna. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Yahoo Question
anyone!!! On Jun 23, 3:28 pm, Priyanshu priyanshuro...@gmail.com wrote: You have 100 computers, connected with each other. Give the most efficient way to design a web crawler, which will crawl most pages in least amount of time. Thanks, Priyanshu. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo coding round question
@ravindara yeah this works perfect -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo coding round question
Here is a simple implementation. Complexity O(n). Please let me know if you find any issues with this. Assumptions as stated in original problem - 1- Required sub array is contiguous 2- Given array has only integers (+ve and -) // Params are array arr, length of array n, given sum and product void subarr( int* arr, int n, int sum, int prod) { int lb = 0; // Lower bound of sub array int s = 0; // Temporary sum int p = 1; // Temporary prod int mod_p = (prod 0) ? prod : (prod * -1); // |prod| int min_p = mod_p * -1; // -|prod| int i=0; int found = 0; for(i=0; in; i++) { // Zero can't be sub array element if given product in not zero if((arr[i] == 0) (prod != 0)) { lb = i+1; s = 0; p = 1; continue; } s += arr[i]; p *= arr[i]; // If product is out of range bring it back in while (p min_p || p mod_p) { p /= arr[lb]; s -= arr[lb]; lb++; } if( s== sum p == prod) { printf (Sub array is from index %d to %d\n, lb, i); found = 1; break; } } if(!found) printf(No Matching sub-array found\n); } Thanks, - Ravindra On Mon, Oct 25, 2010 at 2:04 AM, Kishen Das kishen@gmail.com wrote: @Ravindra, Ligerdave You guys are all right. But with GPUs, you can literally have thousands of threads running in parallel. Again, my aim was not to prove that my O(n ^ 2) algorithm is O ( n) on a single processor system. It was more towards making the members of this group to think on the lines of Parallelism. I long back agreed that the worst case for my algorithm is O(n^2 ) on single processor systems. The current problem is a variation of original subset problem which is NP-complete. ( http://en.wikipedia.org/wiki/Subset_sum_problem ) I really appreciate a O(n) solution to this problem on a single-processor system. Kishen On Sun, Oct 24, 2010 at 1:50 PM, ravindra patel ravindra.it...@gmail.comwrote: It has nothing to do with time complexity. My bad. Wrong choice of words. So in the PRAM model you can say the time complexity is O(1), a pure theoretical concept. But the cost still remains O(n), isn't it. I guess now onwards we'll have to specifically ask interviewers whether they are asking for time complexity on scalar machine or on a parallel machine. Unless specified otherwise, my assumption by default would be a scalar one though. - Ravindra On Sun, Oct 24, 2010 at 11:50 PM, ravindra patel ravindra.it...@gmail.com wrote: @ Kishen So lets say you have 100 parallel processors and you are given an array of 100 elements, then the loop will execute in 1 clock. Now lets say on the same machine you are given a problem array of 1 million elements. So how many clocks are you gonna consume, assuming all your 100 processors are running in parallel. Buddy, with parallel processors you can reduce total computation time at most by a factor of number of processors you have (which will always be a constant, no matter how big it is). It has nothing to do with time complexity. Thanks, - Ravindra On Fri, Oct 22, 2010 at 8:17 AM, Kishen Das kishen@gmail.comwrote: Ok, if you look at the inner loop, it is - for ( j = i to j = 0 ) { sum[j] += A[ i] product[j] *= A [ i] } This is as good as executing - sum[i] = sum [ i ] + A[ i ] --- ( 1 ) sum[i-1]= sum[i-1]+ A[i] ( 2 ) -- --- --- sum[0] = sum[ 0]+A[i] -- ( i ) Each of these assignments doesn't have any dependency with other computations i.e., ( 1 ) is independent of ( 2 ) to ( i ) and so does ( 2 ) , ( 3 ) , ( i ) and hence each of this can be assigned to a different processor. So, each of these statements( iterations) of the inner-loop j can be run in different processors, making it O(1). I am sorry, if people are still not getting my point !!! This is the best I can do !!! Kishen On Thu, Oct 21, 2010 at 9:08 AM, ligerdave david.c...@gmail.comwrote: @Kishen I don't have much knowledge on parallel computation in OpenCL or CUDA. Do you mean parallelised=not have to do the computation at all? did you mean without knowing the boundary of the inner loop which is depended on the outer loop, the inner loop would be smart enough to figure out the i and j? On Oct 20, 7:33 pm, Kishen Das kishen@gmail.com wrote: Well, looks like people are not understanding when I say run a loop in parallel !!! Please look at some of the examples on Nvidia website on how computations can be parallelised in OpenCL or CUDA. And also some of the high level programming languages like Scala which is also providing these parallel constructs. If you don't understand GPUs or not familiar with parallel constructs in Java, then my algorithm will definitely look like O ( n ^ 2 ). Kishen On Wed, Oct 20, 2010 at 4:25 PM, ligerdave david.c...@gmail.com wrote: @Kishen as long as you have one for
Re: [algogeeks] Re: Yahoo coding round question
@ Kishen So lets say you have 100 parallel processors and you are given an array of 100 elements, then the loop will execute in 1 clock. Now lets say on the same machine you are given a problem array of 1 million elements. So how many clocks are you gonna consume, assuming all your 100 processors are running in parallel. Buddy, with parallel processors you can reduce total computation time at most by a factor of number of processors you have (which will always be a constant, no matter how big it is). It has nothing to do with time complexity. Thanks, - Ravindra On Fri, Oct 22, 2010 at 8:17 AM, Kishen Das kishen@gmail.com wrote: Ok, if you look at the inner loop, it is - for ( j = i to j = 0 ) { sum[j] += A[ i] product[j] *= A [ i] } This is as good as executing - sum[i] = sum [ i ] + A[ i ] --- ( 1 ) sum[i-1]= sum[i-1]+ A[i] ( 2 ) -- --- --- sum[0] = sum[ 0]+A[i] -- ( i ) Each of these assignments doesn't have any dependency with other computations i.e., ( 1 ) is independent of ( 2 ) to ( i ) and so does ( 2 ) , ( 3 ) , ( i ) and hence each of this can be assigned to a different processor. So, each of these statements( iterations) of the inner-loop j can be run in different processors, making it O(1). I am sorry, if people are still not getting my point !!! This is the best I can do !!! Kishen On Thu, Oct 21, 2010 at 9:08 AM, ligerdave david.c...@gmail.com wrote: @Kishen I don't have much knowledge on parallel computation in OpenCL or CUDA. Do you mean parallelised=not have to do the computation at all? did you mean without knowing the boundary of the inner loop which is depended on the outer loop, the inner loop would be smart enough to figure out the i and j? On Oct 20, 7:33 pm, Kishen Das kishen@gmail.com wrote: Well, looks like people are not understanding when I say run a loop in parallel !!! Please look at some of the examples on Nvidia website on how computations can be parallelised in OpenCL or CUDA. And also some of the high level programming languages like Scala which is also providing these parallel constructs. If you don't understand GPUs or not familiar with parallel constructs in Java, then my algorithm will definitely look like O ( n ^ 2 ). Kishen On Wed, Oct 20, 2010 at 4:25 PM, ligerdave david.c...@gmail.com wrote: @Kishen as long as you have one for loop in another, you wont have O(n). it will most likely run O(n^2) On Oct 19, 7:41 pm, Kishen Das kishen@gmail.com wrote: In the below code the jth and kth inner for loops can be run in parallel making them O(1) and the entire thing O(n). for ( i=0 to i=N-1 ) { for ( j = i to j = 0 ) { sum[j] += A[ i] product[j] *= A [ i] } for( k=0 to k= i ) if ( sum[k] == S and product[k] == P ) { Answer is the sub array A[k to i ] break } } Kishen On Tue, Oct 19, 2010 at 11:36 AM, abhishek singh iiita2007...@gmail.com wrote: @ Rahul patil ofcourse array may have negative or positive integers @ Kishen both O(n) and O(n logn) solutions was asked in this yahoo coding round question On Tue, Oct 19, 2010 at 1:28 PM, Abhishek Kumar Singh iiita2007...@gmail.com wrote: Given an array of length N. How will you find the minimum length contiguous sub - array of whose sum is S and whose product is P . Here S and P will be given to you. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com algogeeks%2bunsubscr...@googlegroups .com algogeeks%2bunsubscr...@googlegroups .com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- ABHISHEK KUMAR SINGH BTECH (INFORMATION TECHNOLOGY) IIIT ALLAHABAD 9956640538 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com algogeeks%2bunsubscr...@googlegroups .com algogeeks%2bunsubscr...@googlegroups .com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
Re: [algogeeks] Re: Yahoo coding round question
It has nothing to do with time complexity. My bad. Wrong choice of words. So in the PRAM model you can say the time complexity is O(1), a pure theoretical concept. But the cost still remains O(n), isn't it. I guess now onwards we'll have to specifically ask interviewers whether they are asking for time complexity on scalar machine or on a parallel machine. Unless specified otherwise, my assumption by default would be a scalar one though. - Ravindra On Sun, Oct 24, 2010 at 11:50 PM, ravindra patel ravindra.it...@gmail.comwrote: @ Kishen So lets say you have 100 parallel processors and you are given an array of 100 elements, then the loop will execute in 1 clock. Now lets say on the same machine you are given a problem array of 1 million elements. So how many clocks are you gonna consume, assuming all your 100 processors are running in parallel. Buddy, with parallel processors you can reduce total computation time at most by a factor of number of processors you have (which will always be a constant, no matter how big it is). It has nothing to do with time complexity. Thanks, - Ravindra On Fri, Oct 22, 2010 at 8:17 AM, Kishen Das kishen@gmail.com wrote: Ok, if you look at the inner loop, it is - for ( j = i to j = 0 ) { sum[j] += A[ i] product[j] *= A [ i] } This is as good as executing - sum[i] = sum [ i ] + A[ i ] --- ( 1 ) sum[i-1]= sum[i-1]+ A[i] ( 2 ) -- --- --- sum[0] = sum[ 0]+A[i] -- ( i ) Each of these assignments doesn't have any dependency with other computations i.e., ( 1 ) is independent of ( 2 ) to ( i ) and so does ( 2 ) , ( 3 ) , ( i ) and hence each of this can be assigned to a different processor. So, each of these statements( iterations) of the inner-loop j can be run in different processors, making it O(1). I am sorry, if people are still not getting my point !!! This is the best I can do !!! Kishen On Thu, Oct 21, 2010 at 9:08 AM, ligerdave david.c...@gmail.com wrote: @Kishen I don't have much knowledge on parallel computation in OpenCL or CUDA. Do you mean parallelised=not have to do the computation at all? did you mean without knowing the boundary of the inner loop which is depended on the outer loop, the inner loop would be smart enough to figure out the i and j? On Oct 20, 7:33 pm, Kishen Das kishen@gmail.com wrote: Well, looks like people are not understanding when I say run a loop in parallel !!! Please look at some of the examples on Nvidia website on how computations can be parallelised in OpenCL or CUDA. And also some of the high level programming languages like Scala which is also providing these parallel constructs. If you don't understand GPUs or not familiar with parallel constructs in Java, then my algorithm will definitely look like O ( n ^ 2 ). Kishen On Wed, Oct 20, 2010 at 4:25 PM, ligerdave david.c...@gmail.com wrote: @Kishen as long as you have one for loop in another, you wont have O(n). it will most likely run O(n^2) On Oct 19, 7:41 pm, Kishen Das kishen@gmail.com wrote: In the below code the jth and kth inner for loops can be run in parallel making them O(1) and the entire thing O(n). for ( i=0 to i=N-1 ) { for ( j = i to j = 0 ) { sum[j] += A[ i] product[j] *= A [ i] } for( k=0 to k= i ) if ( sum[k] == S and product[k] == P ) { Answer is the sub array A[k to i ] break } } Kishen On Tue, Oct 19, 2010 at 11:36 AM, abhishek singh iiita2007...@gmail.com wrote: @ Rahul patil ofcourse array may have negative or positive integers @ Kishen both O(n) and O(n logn) solutions was asked in this yahoo coding round question On Tue, Oct 19, 2010 at 1:28 PM, Abhishek Kumar Singh iiita2007...@gmail.com wrote: Given an array of length N. How will you find the minimum length contiguous sub - array of whose sum is S and whose product is P . Here S and P will be given to you. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com . To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com algogeeks%2bunsubscr...@googlegroups .com algogeeks%2bunsubscr...@googlegroups .com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- ABHISHEK KUMAR SINGH BTECH (INFORMATION TECHNOLOGY) IIIT ALLAHABAD 9956640538 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to
Re: [algogeeks] Re: Yahoo coding round question
@Mohit: What I understand that in your solution the sum and product array contains the sum and products of contiguous sub-array starting from 0 to i (index of array A). What happens when the expected sub array starts form an index other than 0? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Yahoo coding round question
@ravindra agree! On Oct 24, 2:20 pm, ravindra patel ravindra.it...@gmail.com wrote: @ Kishen So lets say you have 100 parallel processors and you are given an array of 100 elements, then the loop will execute in 1 clock. Now lets say on the same machine you are given a problem array of 1 million elements. So how many clocks are you gonna consume, assuming all your 100 processors are running in parallel. Buddy, with parallel processors you can reduce total computation time at most by a factor of number of processors you have (which will always be a constant, no matter how big it is). It has nothing to do with time complexity. Thanks, - Ravindra On Fri, Oct 22, 2010 at 8:17 AM, Kishen Das kishen@gmail.com wrote: Ok, if you look at the inner loop, it is - for ( j = i to j = 0 ) { sum[j] += A[ i] product[j] *= A [ i] } This is as good as executing - sum[i] = sum [ i ] + A[ i ] --- ( 1 ) sum[i-1]= sum[i-1]+ A[i] ( 2 ) -- --- --- sum[0] = sum[ 0]+A[i] -- ( i ) Each of these assignments doesn't have any dependency with other computations i.e., ( 1 ) is independent of ( 2 ) to ( i ) and so does ( 2 ) , ( 3 ) , ( i ) and hence each of this can be assigned to a different processor. So, each of these statements( iterations) of the inner-loop j can be run in different processors, making it O(1). I am sorry, if people are still not getting my point !!! This is the best I can do !!! Kishen On Thu, Oct 21, 2010 at 9:08 AM, ligerdave david.c...@gmail.com wrote: @Kishen I don't have much knowledge on parallel computation in OpenCL or CUDA. Do you mean parallelised=not have to do the computation at all? did you mean without knowing the boundary of the inner loop which is depended on the outer loop, the inner loop would be smart enough to figure out the i and j? On Oct 20, 7:33 pm, Kishen Das kishen@gmail.com wrote: Well, looks like people are not understanding when I say run a loop in parallel !!! Please look at some of the examples on Nvidia website on how computations can be parallelised in OpenCL or CUDA. And also some of the high level programming languages like Scala which is also providing these parallel constructs. If you don't understand GPUs or not familiar with parallel constructs in Java, then my algorithm will definitely look like O ( n ^ 2 ). Kishen On Wed, Oct 20, 2010 at 4:25 PM, ligerdave david.c...@gmail.com wrote: @Kishen as long as you have one for loop in another, you wont have O(n). it will most likely run O(n^2) On Oct 19, 7:41 pm, Kishen Das kishen@gmail.com wrote: In the below code the jth and kth inner for loops can be run in parallel making them O(1) and the entire thing O(n). for ( i=0 to i=N-1 ) { for ( j = i to j = 0 ) { sum[j] += A[ i] product[j] *= A [ i] } for( k=0 to k= i ) if ( sum[k] == S and product[k] == P ) { Answer is the sub array A[k to i ] break } } Kishen On Tue, Oct 19, 2010 at 11:36 AM, abhishek singh iiita2007...@gmail.com wrote: @ Rahul patil ofcourse array may have negative or positive integers @ Kishen both O(n) and O(n logn) solutions was asked in this yahoo coding round question On Tue, Oct 19, 2010 at 1:28 PM, Abhishek Kumar Singh iiita2007...@gmail.com wrote: Given an array of length N. How will you find the minimum length contiguous sub - array of whose sum is S and whose product is P . Here S and P will be given to you. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups .com algogeeks%2bunsubscr...@googlegroups .com algogeeks%2bunsubscr...@googlegroups .com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- ABHISHEK KUMAR SINGH BTECH (INFORMATION TECHNOLOGY) IIIT ALLAHABAD 9956640538 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups .com algogeeks%2bunsubscr...@googlegroups .com algogeeks%2bunsubscr...@googlegroups .com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to
Re: [algogeeks] Re: Yahoo coding round question
@Ravindra, Ligerdave You guys are all right. But with GPUs, you can literally have thousands of threads running in parallel. Again, my aim was not to prove that my O(n ^ 2) algorithm is O ( n) on a single processor system. It was more towards making the members of this group to think on the lines of Parallelism. I long back agreed that the worst case for my algorithm is O(n^2 ) on single processor systems. The current problem is a variation of original subset problem which is NP-complete. ( http://en.wikipedia.org/wiki/Subset_sum_problem ) I really appreciate a O(n) solution to this problem on a single-processor system. Kishen On Sun, Oct 24, 2010 at 1:50 PM, ravindra patel ravindra.it...@gmail.comwrote: It has nothing to do with time complexity. My bad. Wrong choice of words. So in the PRAM model you can say the time complexity is O(1), a pure theoretical concept. But the cost still remains O(n), isn't it. I guess now onwards we'll have to specifically ask interviewers whether they are asking for time complexity on scalar machine or on a parallel machine. Unless specified otherwise, my assumption by default would be a scalar one though. - Ravindra On Sun, Oct 24, 2010 at 11:50 PM, ravindra patel ravindra.it...@gmail.com wrote: @ Kishen So lets say you have 100 parallel processors and you are given an array of 100 elements, then the loop will execute in 1 clock. Now lets say on the same machine you are given a problem array of 1 million elements. So how many clocks are you gonna consume, assuming all your 100 processors are running in parallel. Buddy, with parallel processors you can reduce total computation time at most by a factor of number of processors you have (which will always be a constant, no matter how big it is). It has nothing to do with time complexity. Thanks, - Ravindra On Fri, Oct 22, 2010 at 8:17 AM, Kishen Das kishen@gmail.com wrote: Ok, if you look at the inner loop, it is - for ( j = i to j = 0 ) { sum[j] += A[ i] product[j] *= A [ i] } This is as good as executing - sum[i] = sum [ i ] + A[ i ] --- ( 1 ) sum[i-1]= sum[i-1]+ A[i] ( 2 ) -- --- --- sum[0] = sum[ 0]+A[i] -- ( i ) Each of these assignments doesn't have any dependency with other computations i.e., ( 1 ) is independent of ( 2 ) to ( i ) and so does ( 2 ) , ( 3 ) , ( i ) and hence each of this can be assigned to a different processor. So, each of these statements( iterations) of the inner-loop j can be run in different processors, making it O(1). I am sorry, if people are still not getting my point !!! This is the best I can do !!! Kishen On Thu, Oct 21, 2010 at 9:08 AM, ligerdave david.c...@gmail.com wrote: @Kishen I don't have much knowledge on parallel computation in OpenCL or CUDA. Do you mean parallelised=not have to do the computation at all? did you mean without knowing the boundary of the inner loop which is depended on the outer loop, the inner loop would be smart enough to figure out the i and j? On Oct 20, 7:33 pm, Kishen Das kishen@gmail.com wrote: Well, looks like people are not understanding when I say run a loop in parallel !!! Please look at some of the examples on Nvidia website on how computations can be parallelised in OpenCL or CUDA. And also some of the high level programming languages like Scala which is also providing these parallel constructs. If you don't understand GPUs or not familiar with parallel constructs in Java, then my algorithm will definitely look like O ( n ^ 2 ). Kishen On Wed, Oct 20, 2010 at 4:25 PM, ligerdave david.c...@gmail.com wrote: @Kishen as long as you have one for loop in another, you wont have O(n). it will most likely run O(n^2) On Oct 19, 7:41 pm, Kishen Das kishen@gmail.com wrote: In the below code the jth and kth inner for loops can be run in parallel making them O(1) and the entire thing O(n). for ( i=0 to i=N-1 ) { for ( j = i to j = 0 ) { sum[j] += A[ i] product[j] *= A [ i] } for( k=0 to k= i ) if ( sum[k] == S and product[k] == P ) { Answer is the sub array A[k to i ] break } } Kishen On Tue, Oct 19, 2010 at 11:36 AM, abhishek singh iiita2007...@gmail.com wrote: @ Rahul patil ofcourse array may have negative or positive integers @ Kishen both O(n) and O(n logn) solutions was asked in this yahoo coding round question On Tue, Oct 19, 2010 at 1:28 PM, Abhishek Kumar Singh iiita2007...@gmail.com wrote: Given an array of length N. How will you find the minimum length contiguous sub - array of whose sum is S and whose product is P . Here S and P will be given to you. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to
Re: [algogeeks] Re: Yahoo coding round question
@saurabh koar : no it will give that sub array .. but kishan das solution is good... btw my code explanation is A: 2 4 356 PRODUCT:2 8 24 120 720 SUM 2 6 9 14 20 suppose i want sum 8 and product 15 make hash table for product array (in hashtable store index of product in array A) suppose at index K.. devide A[i]/15if we get A[i]/ 15 in hash table it means (i+1) to k contains product needed now check for sum ..check ( sum[k]-sum[i]==GIVEN SUM) we get answer A(i+1 to k) example at k =3 120/15=8 will be present in hash table..get index of 8 in array A..here 1 now compute SUM[3]-SUM[1]..which is 8 here as required so answer is A(i+1 to k ) means A(2 to 3) ={3,5} -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo coding round question
Ok, if you look at the inner loop, it is - for ( j = i to j = 0 ) { sum[j] += A[ i] product[j] *= A [ i] } This is as good as executing - sum[i] = sum [ i ] + A[ i ] --- ( 1 ) sum[i-1]= sum[i-1]+ A[i] ( 2 ) -- --- --- sum[0] = sum[ 0]+A[i] -- ( i ) Each of these assignments doesn't have any dependency with other computations i.e., ( 1 ) is independent of ( 2 ) to ( i ) and so does ( 2 ) , ( 3 ) , ( i ) and hence each of this can be assigned to a different processor. So, each of these statements( iterations) of the inner-loop j can be run in different processors, making it O(1). I am sorry, if people are still not getting my point !!! This is the best I can do !!! Kishen On Thu, Oct 21, 2010 at 9:08 AM, ligerdave david.c...@gmail.com wrote: @Kishen I don't have much knowledge on parallel computation in OpenCL or CUDA. Do you mean parallelised=not have to do the computation at all? did you mean without knowing the boundary of the inner loop which is depended on the outer loop, the inner loop would be smart enough to figure out the i and j? On Oct 20, 7:33 pm, Kishen Das kishen@gmail.com wrote: Well, looks like people are not understanding when I say run a loop in parallel !!! Please look at some of the examples on Nvidia website on how computations can be parallelised in OpenCL or CUDA. And also some of the high level programming languages like Scala which is also providing these parallel constructs. If you don't understand GPUs or not familiar with parallel constructs in Java, then my algorithm will definitely look like O ( n ^ 2 ). Kishen On Wed, Oct 20, 2010 at 4:25 PM, ligerdave david.c...@gmail.com wrote: @Kishen as long as you have one for loop in another, you wont have O(n). it will most likely run O(n^2) On Oct 19, 7:41 pm, Kishen Das kishen@gmail.com wrote: In the below code the jth and kth inner for loops can be run in parallel making them O(1) and the entire thing O(n). for ( i=0 to i=N-1 ) { for ( j = i to j = 0 ) { sum[j] += A[ i] product[j] *= A [ i] } for( k=0 to k= i ) if ( sum[k] == S and product[k] == P ) { Answer is the sub array A[k to i ] break } } Kishen On Tue, Oct 19, 2010 at 11:36 AM, abhishek singh iiita2007...@gmail.com wrote: @ Rahul patil ofcourse array may have negative or positive integers @ Kishen both O(n) and O(n logn) solutions was asked in this yahoo coding round question On Tue, Oct 19, 2010 at 1:28 PM, Abhishek Kumar Singh iiita2007...@gmail.com wrote: Given an array of length N. How will you find the minimum length contiguous sub - array of whose sum is S and whose product is P . Here S and P will be given to you. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com algogeeks%2bunsubscr...@googlegroups .com algogeeks%2bunsubscr...@googlegroups .com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- ABHISHEK KUMAR SINGH BTECH (INFORMATION TECHNOLOGY) IIIT ALLAHABAD 9956640538 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com algogeeks%2bunsubscr...@googlegroups .com algogeeks%2bunsubscr...@googlegroups .com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com algogeeks%2bunsubscr...@googlegroups .com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to
[algogeeks] Re: Yahoo coding round question
@Kishen I don't have much knowledge on parallel computation in OpenCL or CUDA. Do you mean parallelised=not have to do the computation at all? did you mean without knowing the boundary of the inner loop which is depended on the outer loop, the inner loop would be smart enough to figure out the i and j? On Oct 20, 7:33 pm, Kishen Das kishen@gmail.com wrote: Well, looks like people are not understanding when I say run a loop in parallel !!! Please look at some of the examples on Nvidia website on how computations can be parallelised in OpenCL or CUDA. And also some of the high level programming languages like Scala which is also providing these parallel constructs. If you don't understand GPUs or not familiar with parallel constructs in Java, then my algorithm will definitely look like O ( n ^ 2 ). Kishen On Wed, Oct 20, 2010 at 4:25 PM, ligerdave david.c...@gmail.com wrote: @Kishen as long as you have one for loop in another, you wont have O(n). it will most likely run O(n^2) On Oct 19, 7:41 pm, Kishen Das kishen@gmail.com wrote: In the below code the jth and kth inner for loops can be run in parallel making them O(1) and the entire thing O(n). for ( i=0 to i=N-1 ) { for ( j = i to j = 0 ) { sum[j] += A[ i] product[j] *= A [ i] } for( k=0 to k= i ) if ( sum[k] == S and product[k] == P ) { Answer is the sub array A[k to i ] break } } Kishen On Tue, Oct 19, 2010 at 11:36 AM, abhishek singh iiita2007...@gmail.com wrote: @ Rahul patil ofcourse array may have negative or positive integers @ Kishen both O(n) and O(n logn) solutions was asked in this yahoo coding round question On Tue, Oct 19, 2010 at 1:28 PM, Abhishek Kumar Singh iiita2007...@gmail.com wrote: Given an array of length N. How will you find the minimum length contiguous sub - array of whose sum is S and whose product is P . Here S and P will be given to you. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups .com algogeeks%2bunsubscr...@googlegroups .com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- ABHISHEK KUMAR SINGH BTECH (INFORMATION TECHNOLOGY) IIIT ALLAHABAD 9956640538 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups .com algogeeks%2bunsubscr...@googlegroups .com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups .com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Yahoo coding round question
i wanna get a clear picture of this before start. when you say min length of contiguous sub of an array let's say array A=[3,1,2,3,4,5], N=6 are below both good solutions? A[0] to A[m] where m=N A[i] to A[m] where i=m m=N On Oct 19, 3:58 am, Abhishek Kumar Singh iiita2007...@gmail.com wrote: Given an array of length N. How will you find the minimum length contiguous sub - array of whose sum is S and whose product is P . Here S and P will be given to you. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Yahoo coding round question
@Kishen as long as you have one for loop in another, you wont have O(n). it will most likely run O(n^2) On Oct 19, 7:41 pm, Kishen Das kishen@gmail.com wrote: In the below code the jth and kth inner for loops can be run in parallel making them O(1) and the entire thing O(n). for ( i=0 to i=N-1 ) { for ( j = i to j = 0 ) { sum[j] += A[ i] product[j] *= A [ i] } for( k=0 to k= i ) if ( sum[k] == S and product[k] == P ) { Answer is the sub array A[k to i ] break } } Kishen On Tue, Oct 19, 2010 at 11:36 AM, abhishek singh iiita2007...@gmail.comwrote: @ Rahul patil ofcourse array may have negative or positive integers @ Kishen both O(n) and O(n logn) solutions was asked in this yahoo coding round question On Tue, Oct 19, 2010 at 1:28 PM, Abhishek Kumar Singh iiita2007...@gmail.com wrote: Given an array of length N. How will you find the minimum length contiguous sub - array of whose sum is S and whose product is P . Here S and P will be given to you. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups .com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- ABHISHEK KUMAR SINGH BTECH (INFORMATION TECHNOLOGY) IIIT ALLAHABAD 9956640538 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups .com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo coding round question
Well, looks like people are not understanding when I say run a loop in parallel !!! Please look at some of the examples on Nvidia website on how computations can be parallelised in OpenCL or CUDA. And also some of the high level programming languages like Scala which is also providing these parallel constructs. If you don't understand GPUs or not familiar with parallel constructs in Java, then my algorithm will definitely look like O ( n ^ 2 ). Kishen On Wed, Oct 20, 2010 at 4:25 PM, ligerdave david.c...@gmail.com wrote: @Kishen as long as you have one for loop in another, you wont have O(n). it will most likely run O(n^2) On Oct 19, 7:41 pm, Kishen Das kishen@gmail.com wrote: In the below code the jth and kth inner for loops can be run in parallel making them O(1) and the entire thing O(n). for ( i=0 to i=N-1 ) { for ( j = i to j = 0 ) { sum[j] += A[ i] product[j] *= A [ i] } for( k=0 to k= i ) if ( sum[k] == S and product[k] == P ) { Answer is the sub array A[k to i ] break } } Kishen On Tue, Oct 19, 2010 at 11:36 AM, abhishek singh iiita2007...@gmail.com wrote: @ Rahul patil ofcourse array may have negative or positive integers @ Kishen both O(n) and O(n logn) solutions was asked in this yahoo coding round question On Tue, Oct 19, 2010 at 1:28 PM, Abhishek Kumar Singh iiita2007...@gmail.com wrote: Given an array of length N. How will you find the minimum length contiguous sub - array of whose sum is S and whose product is P . Here S and P will be given to you. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com algogeeks%2bunsubscr...@googlegroups .com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- ABHISHEK KUMAR SINGH BTECH (INFORMATION TECHNOLOGY) IIIT ALLAHABAD 9956640538 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com algogeeks%2bunsubscr...@googlegroups .com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Yahoo Question
@umesh kewat : In worst case it will be O(nk) in case of your solution. check for this case: 01-06-11-16 02-07-12-17 03-08-13-18 04-09-14-19 05-10-15-20 -- Krunal -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Yahoo Question
@umesh kewat: In worst case it will be O(n*k), by your solution. 01-06-11-16 02-07-12-17 03-08-13-18 04-09-14-19 05-10-15-20 -- Krunal By umesh kewat: Create binary search tree using n nodes of K list den do in-order and make a single list -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Yahoo Interview Question for Software Engineer/Developer about Algorithms
Even if u are connected to that person via some another friend it'll show the shortest chain by which you are connected to that person..So DFS will be optimum i guessWhy do you think it wouldn't be optimum.? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo Interview Question for Software Engineer/Developer about Algorithms
i will choose BFS. As we just don't want to show a connection.. we want to show the shortest one. On Sat, Sep 18, 2010 at 4:12 PM, soundar soundha...@gmail.com wrote: Even if u are connected to that person via some another friend it'll show the shortest chain by which you are connected to that person..So DFS will be optimum i guessWhy do you think it wouldn't be optimum.? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Yahoo Interview Question for Software Engineer/Developer about Algorithms
You could construct two level graphs starting starting simultanously from your node and the other member's. Add layers one at a time to each. When, after adding a new level, you find one or more nodes in both level graphs, you can stop. Each shared node gives you a least-edge path between the two start nodes. By roughly halving the depth of a simple BFS, you avoid touching k^(D-1)nodes in a graph with degree k, which is a useful trick. Whether this is optimal can't be said because you haven't defined optimality. In case some haven't heard the term, a level graph is formed by breadth first search in stages. First you find all nodes reachable from the start node by 1 edge traversal. This is level 1. Then find all unfound nodes reachable by 1 edge from level 1 nodes. This is level 2, etc. On Sep 18, 4:04 am, bittu shashank7andr...@gmail.com wrote: 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 modifications will help but wouldn't be most optimum way Regards Shashank Mani Computer Science Engineering Birla Institute of Technology,Mesra Cell No. +91-9166674831 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Yahoo Question
@Bittu I am confused about one point you need to process atleast n*k elements so how will you do it in nlogk time. It seems really tricky if possible.it's min time should be O(nk). correct me if I am wrong. On Sep 17, 6:34 am, tkcn tkcna...@gmail.com wrote: Use k-way merging +1. 1. Before the merging start, sorting these lists according to the first element of each list. // O(k log k) 2. So the first element in the first list is the smallest element. Put the smallest into the result array. // O(1) 3. Then, using binary search to find the new position of the first list // O(k) 4. These lists are still sorted, so the first element in the first list is still smallest. Just repeat the step 2, 3 n times. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo Question
Create binary search tree using n nodes of K list den do in-order and make a single list On Fri, Sep 17, 2010 at 12:58 PM, vikas kumar vikas.kumar...@gmail.comwrote: @Bittu I am confused about one point you need to process atleast n*k elements so how will you do it in nlogk time. It seems really tricky if possible.it's min time should be O(nk). correct me if I am wrong. On Sep 17, 6:34 am, tkcn tkcna...@gmail.com wrote: Use k-way merging +1. 1. Before the merging start, sorting these lists according to the first element of each list. // O(k log k) 2. So the first element in the first list is the smallest element. Put the smallest into the result array. // O(1) 3. Then, using binary search to find the new position of the first list // O(k) 4. These lists are still sorted, so the first element in the first list is still smallest. Just repeat the step 2, 3 n times. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Thanks Regards Umesh kewat -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo Question
@vikas: Total number of elements are not n*k. Total number of elements are n, which are divided into k lists. @Rahul Singal: +1 for ur answer. On Fri, Sep 17, 2010 at 12:58 PM, vikas kumar vikas.kumar...@gmail.comwrote: @Bittu I am confused about one point you need to process atleast n*k elements so how will you do it in nlogk time. It seems really tricky if possible.it's min time should be O(nk). correct me if I am wrong. On Sep 17, 6:34 am, tkcn tkcna...@gmail.com wrote: Use k-way merging +1. 1. Before the merging start, sorting these lists according to the first element of each list. // O(k log k) 2. So the first element in the first list is the smallest element. Put the smallest into the result array. // O(1) 3. Then, using binary search to find the new position of the first list // O(k) 4. These lists are still sorted, so the first element in the first list is still smallest. Just repeat the step 2, 3 n times. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. Please access the attached hyperlink for an important electronic communications disclaimer: http://dce.edu/web/Sections/Standalone/Email_Disclaimer.php -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Yahoo Question
Use k-way merging +1. 1. Before the merging start, sorting these lists according to the first element of each list. // O(k log k) 2. So the first element in the first list is the smallest element. Put the smallest into the result array. // O(1) 3. Then, using binary search to find the new position of the first list // O(k) 4. These lists are still sorted, so the first element in the first list is still smallest. Just repeat the step 2, 3 n times. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Yahoo Question:Greatest Sub-sequential sum
what is the complexity of this problem I think its O(n*n!) but confused or O(n!) or O(n^2) right me if i m wrong.its necessary to check the complexity REPLY is appreciated from every algogeek #include stdio.h #includeconio.h #includeiostream.h #includestdlib.h int main() { int a[] = {-1 , -2 , 3 , 5 , 6 , -2 , -1 , 4 , -4 , 2 , -1}; int length = 11; int begin, end, beginmax, endmax, maxsum, sum, i; sum = 0; beginmax = 0; endmax = -1; maxsum = 0; for (begin=0; beginlength; begin++) { sum = 0; for(end=begin; endlength; end++) { sum += a[end]; if(sum maxsum) { maxsum = sum; beginmax = begin; endmax = end; } } coutsum\t; } coutendl; for(i=beginmax; i=endmax; i++) { printf(%d\n, a[i]); } getch(); } its has time complexity O(n^2) ..does better solution exist -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo
@peeyush: the ratio is based on probability, it will be 1:1. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Yahoo
ya i mean half girl and half boys i.e. 1:1 ratio of boys to girl On Sun, Jul 4, 2010 at 5:25 PM, peeyush peeyush...@gmail.com wrote: It can not be determined. On Jul 4, 4:27 pm, Amit Jaspal amitjaspal...@gmail.com wrote: it will be 1:1 On Sun, Jul 4, 2010 at 4:50 PM, Jitendra Kushwaha jitendra.th...@gmail.comwrote: it will be half... On Sun, Jul 4, 2010 at 4:18 PM, Piyush Verma 114piy...@gmail.com wrote: In a village in each family they give birth to children till they get a boy. IF girl child they try again. What is the ratio of boys to girls. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com algogeeks%2bunsubscr...@googlegroups.comalgogeeks%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Jitendra Kushwaha MNNIT, Allahabad -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com algogeeks%2bunsubscr...@googlegroups.comalgogeeks%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Jitendra Kushwaha MNNIT, Allahabad -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Yahoo coding round question
One (space-intensive) idea: Re-represent each string as a set of pairs (character, position of character). Then sort each set of pairs by character. Then find corresponding sequences in the sorted lists of pairs, where the character and the difference between position is the same from pair to pair in the sequence. Then narrow down the sequences to those that actually are substrings of adjacent characters and choose the longest. On May 8, 5:00 am, Jitendra Kushwaha jitendra.th...@gmail.com wrote: Find the longest common subsequence of given N strings each having length between 0 to M. Can anybody give a good approach to the solutions -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.