[algogeeks] Re: give the algo or program to find second largest element in a list using tournament method

2012-08-30 Thread Don
While the list length is more than one Take 2 elements from the head Select the larger of the two If the smaller is greater than the largest beaten by the larger Then set the largest beaten by the larger to the value of the smaller Add the larger to the tail of the list When

Re: [algogeeks] Re: give the algo or program to find second largest element in a list using tournament method

2012-08-30 Thread Navin Kumar
@sangeeta: n-1 comparison required to choose winner. By tournament approach winner has played match with logn team and winner must have beaten second largest element. So among logn number we can select maximum in logn - 1 comparison. So total comparison required is: n + logn -2 On Thu, Aug 30, 20

Re: [algogeeks] Re: give the algo or program to find second largest element in a list using tournament method

2012-08-30 Thread sangeeta goyal
@Don can you give the algorithm for the same?? how would you implement it?? On Thu, Aug 30, 2012 at 10:03 PM, Don wrote: > The second largest element is the largest element beaten by the > winner. > So if you implement a tournament in which each element keeps track of > the largest element it ha

Re: [algogeeks] LOGIC!!!

2012-08-30 Thread Saurabh Kumar
I think, if the Graph is 2-colorable (i.e. Bipartite) trip can be arranged. On 30 August 2012 09:43, ashish mann wrote: > Q. A company organizes two foreign trips for its employees yearly. Aim of > the trip is to increase interaction among the employees of the company and > hence company wants e

[algogeeks] Microsoft online exam pattern

2012-08-30 Thread Abhi
Can anyone tell me the type of questions asked in Microsoft's online exam, their difficulty level and especially the questions related to test cases (pls also post some examples) ? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view thi

Re: [algogeeks] use of static

2012-08-30 Thread rahul
static doing nothing, just to make a candidate confuse in interview. static comes into picture, when u calling same function again and again and u need some variable to retain the old value, and another scenario when u have to define the scope of variable. On Thu, Aug 30, 2012 at 6:02 PM, Puneet

[algogeeks] Re: LOGIC!!!

2012-08-30 Thread Don
For each employee, keep track of which vacation he is assigned to, if any. Start with all employees unassigned. 1. Pick the first pair who have worked together and are currently unassigned. Assign one to Trip A and the other to Trip B. 2. Loop over all pairs. If a pair are assigned to the same tri

[algogeeks] Re: give the algo or program to find second largest element in a list using tournament method

2012-08-30 Thread Don
The second largest element is the largest element beaten by the winner. So if you implement a tournament in which each element keeps track of the largest element it has beaten, you'll get the second largest naturally. Don On Aug 29, 9:15 am, Sangeeta wrote: > give the algo or program to find seco

[algogeeks] ip traceback

2012-08-30 Thread muthulakshmi
can stochastic diffusion search be applied for ip traceback mechanism??? if yes please explain me... -- 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/-/Pw9bgA

Re: [algogeeks] Snapdeal Paper Pattern

2012-08-30 Thread Rabi Chandra Shah
@Jitesh .. What about the question pattern ??? Does the question pattern include aptitude section ?? On Thu, Aug 30, 2012 at 7:51 PM, JITESH KUMAR wrote: > Get yourself prepared for DS and Algo.. Thats it. > > > On Fri, Aug 24, 2012 at 5:10 PM, vaibhav shukla > wrote: > >> its DU . please guide

Re: [algogeeks] Snapdeal Paper Pattern

2012-08-30 Thread JITESH KUMAR
Get yourself prepared for DS and Algo.. Thats it. On Fri, Aug 24, 2012 at 5:10 PM, vaibhav shukla wrote: > its DU . please guide with watever details you have. > thanks > > > On Fri, Aug 24, 2012 at 4:42 PM, JITESH KUMAR wrote: > >> Which college? >> I can help you. >> >> >> On Wed, Aug 22, 2012

Re: [algogeeks] use of static

2012-08-30 Thread Puneet Gautam
Well, its gives error in every array assignment.."ISO forbids this type of assignment". @rahul: But whats with the static here. how does it affect any string declared..? I couldnt get your answer ..pls explain On Thu, Aug 30, 2012 at 12:54 PM, rahul wrote: > old style C, where you can't have aut

[algogeeks] LOGIC!!!

2012-08-30 Thread ashish mann
Q. A company organizes two foreign trips for its employees yearly. Aim of the trip is to increase interaction among the employees of the company and hence company wants each of his employee to see new people on the trip and not even a single person with whom he has worked in past. Therefore it is a

Re: [algogeeks] use of static

2012-08-30 Thread rahul
old style C, where you can't have auto array. just that. On Thu, Aug 30, 2012 at 12:52 PM, Romil ... wrote: > It should give an error in the line " names[3] = names[4] " > These are fixed address values..you cannot change them. > > > On Thu, Aug 30, 2012 at 12:44 PM, Puneet Gautam > wrote: >

Re: [algogeeks] use of static

2012-08-30 Thread Romil .......
It should give an error in the line " names[3] = names[4] " These are fixed address values..you cannot change them. On Thu, Aug 30, 2012 at 12:44 PM, Puneet Gautam wrote: > #include > int main() > {static char names[5][20]={"pascal","ada","cobol","fortran","perl"}; > int i; > char *t; > t=names[3

[algogeeks] use of static

2012-08-30 Thread Puneet Gautam
#include int main() {static char names[5][20]={"pascal","ada","cobol","fortran","perl"}; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for (i=0;i<=4;i++) cout