[algogeeks] Java Tree Datastructure
Hi Can anybody suggest a program on how to convert a n-ary tree to an array and reconstruct the tree from the array in java? Thanks -- 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] C concept on memory layout
i didn't got .. !! please explain some more.. On 2/7/12, sumit mahamuni sumit143smail...@gmail.com wrote: Hello, Here you are right about variable p in add function that it retains it's value even though function loses its scope. And for main function error you are seeing has nothing to do with how that variable is stored? It is about the scope of that variable C compiler sees the scope of static variable p limited to add function only, so other function can't use it. And remember error is at compile time not run time so it is related to compiler not memory. I hope it explains everything. On Tue, Feb 7, 2012 at 9:43 AM, atul anand atul.87fri...@gmail.com wrote: http://www.geeksforgeeks.org/archives/14268 On Tue, Feb 7, 2012 at 1:06 AM, gmagog...@gmail.com gmagog...@gmail.comwrote: I think you are right about p being in BSS segment and it does last even the function finishes, however, you may need a pointer to get the data out of p. Then you can read the data. Correct me if i am wrong On Mon, Feb 6, 2012 at 1:04 PM, Ravi Ranjan ravi.cool2...@gmail.comwrote: i have a confusion in it #include stdio.h #include stdlib.h void add(int,int); int main(int argc, char *argv[]) { add(6,3); printf(%d,p); system(PAUSE); return 0; } void add(int a, int b) { static int p; p = a+ b; } here the memory layout says variable p is in BSS segment ... so its an independent region from stack frame. when the function looses its scope from function defination(add) then still it should be alive... and can be recognized/used by other function(main) but it gves an error of unknown variable p. need the correct logic... if i m wrong... thanx ravi -- 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. -- Thanks and Regards, Sumit Mahamuni. -- Slow code that scales better can be faster than fast code that doesn't scale! -- Tough times never lasts, but tough people do. -- I love deadlines. I like the whooshing sound they make as they fly by. - D. Adams -- 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]
@^ : We are just going to do a BFS kind of thing is crawler, its better to use a bqueue/b for implementing it. rest to store it , we can use accordingly like if we have just to store the URL we can use a pretty simple DS like arrays, or say Linklists(if its very large) . but if we need to store entire thing HTML , then we have to go to DOM structures so store it, in something like XML tags. On 2/7/12, Durgesh Kumar durgesh1...@gmail.com wrote: U can use dictionary or linked list Better if U choose language like python or java. Python have module named Urllib2 and httplib2 which implements all the functions for getiing ,posting and browsing data. INFORMAL ALGORITHM.. 1. Start with any arbitray link. LINK=[new link] 2.aGet html content of the link . bParse the required Content and store it . cAdd the new link on the page to the LINK it it is not present there. 3.Repeat step 2 untill U want to crawl. On 2/5/12, Ravi Ranjan ravi.cool2...@gmail.com wrote: what will the algorithm and the appropriate data structure to implement a web crawler?? -- 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. -- *Durgesh Kumar* Final Year, B.tech Information Technology HALDIA INSTITUTE OF TCHNOLOGY HALDIA -- 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: Java Tree Datastructure
@DT Use BFS (Queue) , try it. -- *Thanks Shashank Mani Narayan Computer Science Engineering Birla Institute of Technology,Mesra ** Founder Cracking The Code Lab http://shashank7s.blogspot.com/* -- 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/-/NHU-lOy0_e8J. 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] C concept on memory layout
i think guys are confuse between scope of variable and lifetime of variable. p scope is add function and lifetime of p is till the program run. so u can't access variable outside the scope of variable whatever is the lifetime of variable. u can look at peter ven den linden Deep C secrets. best regards, On Tue, Feb 7, 2012 at 10:43 AM, Manni mbd mbd2...@gmail.com wrote: i didn't got .. !! please explain some more.. On 2/7/12, sumit mahamuni sumit143smail...@gmail.com wrote: Hello, Here you are right about variable p in add function that it retains it's value even though function loses its scope. And for main function error you are seeing has nothing to do with how that variable is stored? It is about the scope of that variable C compiler sees the scope of static variable p limited to add function only, so other function can't use it. And remember error is at compile time not run time so it is related to compiler not memory. I hope it explains everything. On Tue, Feb 7, 2012 at 9:43 AM, atul anand atul.87fri...@gmail.com wrote: http://www.geeksforgeeks.org/archives/14268 On Tue, Feb 7, 2012 at 1:06 AM, gmagog...@gmail.com gmagog...@gmail.comwrote: I think you are right about p being in BSS segment and it does last even the function finishes, however, you may need a pointer to get the data out of p. Then you can read the data. Correct me if i am wrong On Mon, Feb 6, 2012 at 1:04 PM, Ravi Ranjan ravi.cool2...@gmail.comwrote: i have a confusion in it #include stdio.h #include stdlib.h void add(int,int); int main(int argc, char *argv[]) { add(6,3); printf(%d,p); system(PAUSE); return 0; } void add(int a, int b) { static int p; p = a+ b; } here the memory layout says variable p is in BSS segment ... so its an independent region from stack frame. when the function looses its scope from function defination(add) then still it should be alive... and can be recognized/used by other function(main) but it gves an error of unknown variable p. need the correct logic... if i m wrong... thanx ravi -- 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. -- Thanks and Regards, Sumit Mahamuni. -- Slow code that scales better can be faster than fast code that doesn't scale! -- Tough times never lasts, but tough people do. -- I love deadlines. I like the whooshing sound they make as they fly by. - D. Adams -- 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: Java Tree Datastructure
algo will be something like this:- i=0; arr[i]=root; enqueue(root); while queue is not empty temp=dequeue(); i =search for element temp in array temp and return it index if(temp-left!=NULL) { arr[2*i+1]=temp-left; enqueue(temp-left); } if(temp-right!=NULL) { arr[2*i+2]=temp-right; enqueue(temp-right); } } On Tue, Feb 7, 2012 at 2:18 PM, WgpShashank shashank7andr...@gmail.comwrote: @DT Use BFS (Queue) , try it. -- *Thanks Shashank Mani Narayan Computer Science Engineering Birla Institute of Technology,Mesra ** Founder Cracking The Code Lab http://shashank7s.blogspot.com/* -- 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/-/NHU-lOy0_e8J. 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: Find all longest increasing subsequence of length k
hi atul, will the output also have these sequence or only those you mentioned? + 7 8 11 + 7 8 10 + 7 9 11 + 8 9 11 + 4 10 11 can u explain the question more? On Jan 30, 12:43 pm, Manni mbd mbd2...@gmail.com wrote: @Manee: can u explain a bit more !! still unclear On 1/30/12, Manee mani.ma...@gmail.com wrote: store all the indices wherever the value decreases. all subsequences between 0, these indices and the end index n are increasing subsequences. Check which of these are of length K. On Jan 26, 11:17 pm, atul anand atul.87fri...@gmail.com wrote: Hi, suggest an algo which will find all longest increasing sub sequence of length K. for eg:- input : 7 8 9 4 10 11 K=3 output : 7 8 9 7 9 10 7 10 11 8 9 10 8 10 11 desired complexity : O(k*n*logn) -- 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: Java Tree Datastructure
Thanks for the reply. But is this solution the most efficient one or do we have better space complexity algos available? The code below will introduce array indexes with empty values whenever the left/right child is null. On Feb 7, 2:06 pm, atul anand atul.87fri...@gmail.com wrote: algo will be something like this:- i=0; arr[i]=root; enqueue(root); while queue is not empty temp=dequeue(); i =search for element temp in array temp and return it index if(temp-left!=NULL) { arr[2*i+1]=temp-left; enqueue(temp-left); } if(temp-right!=NULL) { arr[2*i+2]=temp-right; enqueue(temp-right); } } On Tue, Feb 7, 2012 at 2:18 PM, WgpShashank shashank7andr...@gmail.comwrote: @DT Use BFS (Queue) , try it. -- *Thanks Shashank Mani Narayan Computer Science Engineering Birla Institute of Technology,Mesra ** Founder Cracking The Code Lab http://shashank7s.blogspot.com/* -- 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/-/NHU-lOy0_e8J. 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: Find all longest increasing subsequence of length k
@vetri : yes right , include your sequence to my output. On Tue, Feb 7, 2012 at 4:07 PM, vetri natarajananitha...@gmail.com wrote: hi atul, will the output also have these sequence or only those you mentioned? + 7 8 11 + 7 8 10 + 7 9 11 + 8 9 11 + 4 10 11 can u explain the question more? On Jan 30, 12:43 pm, Manni mbd mbd2...@gmail.com wrote: @Manee: can u explain a bit more !! still unclear On 1/30/12, Manee mani.ma...@gmail.com wrote: store all the indices wherever the value decreases. all subsequences between 0, these indices and the end index n are increasing subsequences. Check which of these are of length K. On Jan 26, 11:17 pm, atul anand atul.87fri...@gmail.com wrote: Hi, suggest an algo which will find all longest increasing sub sequence of length K. for eg:- input : 7 8 9 4 10 11 K=3 output : 7 8 9 7 9 10 7 10 11 8 9 10 8 10 11 desired complexity : O(k*n*logn) -- 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: Java Tree Datastructure
you can use hashtable , hash at calculated index, no need of saving empty spaces. On Tue, Feb 7, 2012 at 4:38 PM, DT pa7...@gmail.com wrote: Thanks for the reply. But is this solution the most efficient one or do we have better space complexity algos available? The code below will introduce array indexes with empty values whenever the left/right child is null. On Feb 7, 2:06 pm, atul anand atul.87fri...@gmail.com wrote: algo will be something like this:- i=0; arr[i]=root; enqueue(root); while queue is not empty temp=dequeue(); i =search for element temp in array temp and return it index if(temp-left!=NULL) { arr[2*i+1]=temp-left; enqueue(temp-left); } if(temp-right!=NULL) { arr[2*i+2]=temp-right; enqueue(temp-right); } } On Tue, Feb 7, 2012 at 2:18 PM, WgpShashank shashank7andr...@gmail.com wrote: @DT Use BFS (Queue) , try it. -- *Thanks Shashank Mani Narayan Computer Science Engineering Birla Institute of Technology,Mesra ** Founder Cracking The Code Lab http://shashank7s.blogspot.com/* -- 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/-/NHU-lOy0_e8J. 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] PRAYATNA '12 - A NATIONAL LEVEL TECHNICAL SYMPOSIUM
-- Forwarded message -- From: Harikannan Shanmugam harikannan.mi...@gmail.com Date: Tue, Feb 7, 2012 at 5:37 PM Subject: Fwd: PRAYATNA '12 - A NATIONAL LEVEL TECHNICAL SYMPOSIUM To: ananth...@gmail.com, arivu04@gmail.com, aru.valarpu...@gdit.com, aru.valarpu...@gmail.com, cccha...@gmail.com, cserebels_...@googlegroups.com, dharnee.tha...@gmail.com, fathimasof...@ymail.com, g.d.dharaneetha...@gmail.com, gokilavarthan...@gmail.com, gokilavas...@gmail.com, gowthams...@gmail.com, gsivagurunat...@inautix.co.in, janani_...@yahoo.in, jayaprakash_star1...@yahoo.com, spgo...@hotmail.com, ts.assignm...@gmail.com, Aru Valarpuram aru.porche...@gmail.com, arul Kumar pkak...@gmail.com, arunkumar shanmugam arun31...@gmail.com, ashok kumar kosha.ra...@gmail.com, Avinash Radhakrishnan avinash.radhakrish...@gmail.com, bharathimit15 bharathimi...@gmail.com, Boobal Subramaniyam booban...@gmail.com, Bosco Anandraj boscoanand...@gmail.com, Chandra Sekar Narayanan 007.chandru.v...@gmail.com, deeps1991 deeps1...@gmail.com, Dharaneetharan G D dharanee.tha...@gmail.com, ganesh margabandu gan.mi...@gmail.com, gnanavelu...@gmail.com gnanavelu...@gmail.com, Gowtham Venkataraman scraptogowt...@gmail.com, hari harish harid...@gmail.com, harikannan shanmugam harikannan.mi...@gmail.com, Inba G mk7ru...@gmail.com, joyarunraj.20 joyarunraj...@gmail.com, KarthicK S harrypotter.wiz...@gmail.com, karthikeyan A quickslver2...@gmail.com, kncr...@gmail.com kncr...@gmail.com, ksprakash1990 ksprakash1...@gmail.com, lokesh lokesh lokeshmit@gmail.com, lokesh lokesh sripathi.karth...@gmail.com, Madhu R madhumi...@gmail.com, mayupath mayup...@gmail.com, mitcse08info mitcse08i...@googlegroups.com, nandhakumarr03 nandhakumar...@gmail.com, Navin G V gvnavi...@gmail.com, PAZHANI RAJAN pazhani.mit.2...@gmail.com, Prabhu Ravichandran prabhucs...@gmail.com, prakashdharmaraj prakashdharma...@gmail.com, Prasanna Kumar prasannakumar...@gmail.com, prasanth kumar prasanth270...@gmail.com, ra.aravind18 ra.aravin...@gmail.com, ramash4647 ramesh4...@gmail.com, S.Gokul Kannan spgo...@gmail.com, Sagar Gahuri sgah...@gmail.com, sathishpp jec sathishpp...@gmail.com, sathiya prakash sathya3@gmail.com, shankar15.gow shankar15@gmail.com, Shikhar Goel shikhar1...@gmail.com, siva viknesh sivavikne...@gmail.com, sudhir kumar sudhirkumar...@gmail.com, Tamil selvan R.S tamil.3...@gmail.com, Tariq Ibrahim tariq9112...@gmail.com, Thamizharasu Kannazhagan thamizhkar...@gmail.com, v.vengadesh17 v.vengades...@gmail.com, Vel Murugan vel...@gmail.com, vimalrkambat vimalrkam...@gmail.com, Vinodh M vinovinm...@gmail.com, Yogeshwaran Harikrishnan yonarcis...@gmail.com -- Forwarded message -- From: Association of Computer Technology MIT,Anna University,Chennai a...@mitindia.edu Date: 7 February 2012 14:48 Subject: PRAYATNA '12 - A NATIONAL LEVEL TECHNICAL SYMPOSIUM To: guruv...@gmail.com, gutsve...@gmail.com, gv.vick...@gmail.com, gvjilavar...@gmail.com, gvnavi...@gmail.com, h2010...@bits-pilani.ac.in, haleemullah2...@gmail.com, hamir...@yahoo.co.in, haranivaithianat...@yahoo.com, haricdm1...@gmail.com, hariha...@cheerful.com, harikannan.mi...@gmail.com, harikrishnan...@gmail.com, harini1...@gmail.com, harini...@gmail.com, hari...@gmail.com, harish.mi...@gmail.com, harish.mit...@gmail.com, harishsmar...@yahoo.co.in, harishz...@gmail.com, hariyogi.1...@yahoo.in, hari_krishc...@yahoo.in, harrishsm...@gmail.com, hasind...@gmail.com *PRAYATNA '12 - IMAGINATION TENDS TO INFINITYhttp://prayatnafest.blogspot.com/ * Hi , We, the members of The Association of Computer Technologistshttp://www.act.mitindia.edu/, Department of Computer Technology, Anna Universityhttp://www.annauniv.edu/ , MIT campus http://www.mitindia.edu/ take great pride in announcing and conducting our National Level Technical Symposium, *Prayatna '12http://www.prayatna.org.in/ * on *Mar 2 3.* It is held to commemorate yesterday's advances, further tomorrow's achievements. This is where smartness meets swords. Students from various reputed institutions will flock to take part in this event. In a nutshell, PRAYATNA '12 churns the technical knowledge of upcoming engineers by testing their aptitude in programming, designing , problem-solving and quizzing concepts related to multifaceted domain.To increase the talent pool and overcome the technical divide, Special Workshops will be organised for the participants. Advancing through the oceans of knowledge, we are back with multifarious designs, innovative ideas, immense passion , philanthropic challenges and up-to-date technologies . The chase to become the brightest and the smartest among various intellectual groups continues and the dreams to become the ubergeek are reinstalled. We proudly present Prayatna '12 ( a Prayatna '11 ++ ) with lots of challenging onlinehttp://www.prayatna.org.in/index.php/events/online-events events ,exciting
Re: [algogeeks]
1.You can use wget to get the homepage source. 2.Then u can grep the links in it and using cut to get the clear links associated in that page. 3.Doing that recursively all links can be crawled. -- ATul Singh | Final Year | Computer Science Engineering | NIT Jalandhar | 9530739855 | -- 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] C concept on memory layout
I think rahul has given a clear solution i.e why the static variable is not accessible in main() function because of its scope. I would like to add one more point in this...that Static variables may be initialized in their declarations; however, the initializers must be constant expressions, and initialization is done only once at compile time when memory is allocated for the static variable -- ATul Singh | Final Year | Computer Science Engineering | NIT Jalandhar | 9530739855 | -- 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] Function Name Mismatch
Hii to all If client want to make a function call to a server(vice versa), but it doesn't know exact name . so we need a adapter. for this i have to design a adapter (middleware) so that client can make a call and adapter make that call to exact match. please help me for same. how to design adapter? -- 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] C concept on memory layout
@all thanx for the explanation.. -- 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: Function Name Mismatch
Provide an interface class for the client to access. The client needs to know the name of the method in the interface, but only the interface needs to know the name of the function in the server. Don On Feb 7, 8:38 am, Aman Kumar amanas...@gmail.com wrote: Hii to all If client want to make a function call to a server(vice versa), but it doesn't know exact name . so we need a adapter. for this i have to design a adapter (middleware) so that client can make a call and adapter make that call to exact match. please help me for same. how to design adapter? -- 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: Function Name Mismatch
This is a simple implementation to Factory Design Pattern. What you have to do is make an arbitrary class (Your Adapter) and always call this. However, the implementation of this class should be smart enough to route your call accordingly. As suggested by DON , its the c++ implementation of Factory Class. However , if you are designing in any other language, It is alwasyz advisable to have a sample implementation of Factory design pattern. On Tue, Feb 7, 2012 at 11:23 PM, Don dondod...@gmail.com wrote: Provide an interface class for the client to access. The client needs to know the name of the method in the interface, but only the interface needs to know the name of the function in the server. Don On Feb 7, 8:38 am, Aman Kumar amanas...@gmail.com wrote: Hii to all If client want to make a function call to a server(vice versa), but it doesn't know exact name . so we need a adapter. for this i have to design a adapter (middleware) so that client can make a call and adapter make that call to exact match. please help me for same. how to design adapter? -- 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] Reading till EOF using cin
hi, how to read till end of file in c++ using cin ? string str; while(!cin.eof()) { cin str; cout str endl; } but it is not working correctly. It is printing the last line twice. Can anyone tell why ? -- 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] Reading till EOF using cin
string str; while(cin str) { cout str endl; } -- 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: Find all longest increasing subsequence of length k
OK then I guess this will do but not sure. 1. Traverse the list from 1st to n-k (if n is the length of the list). only those numbers to the left of this index n-k can be represented as the starting number in sequence. 2. Also mark the indices of increasing number. i.e., for the above list:- list= 7,8,9,4,10,11 so till 3rd index we should traverse; for each number, 7 8,9,10,11 89,10,11 910,11 410,11 3. Now taking 3 numbers(k=3) at a time and leaving the rest.i.e., 7 8 9, 7 8 10, 7 8 11, 7 9 10, 7 9 11, 7 10 11 8 9 10, 8 9 11, 8 10 11, 9 10 11 4 10 11 On Feb 7, 4:26 pm, atul anand atul.87fri...@gmail.com wrote: @vetri : yes right , include your sequence to my output. On Tue, Feb 7, 2012 at 4:07 PM, vetri natarajananitha...@gmail.com wrote: hi atul, will the output also have these sequence or only those you mentioned? + 7 8 11 + 7 8 10 + 7 9 11 + 8 9 11 + 4 10 11 can u explain the question more? On Jan 30, 12:43 pm, Manni mbd mbd2...@gmail.com wrote: @Manee: can u explain a bit more !! still unclear On 1/30/12, Manee mani.ma...@gmail.com wrote: store all the indices wherever the value decreases. all subsequences between 0, these indices and the end index n are increasing subsequences. Check which of these are of length K. On Jan 26, 11:17 pm, atul anand atul.87fri...@gmail.com wrote: Hi, suggest an algo which will find all longest increasing sub sequence of length K. for eg:- input : 7 8 9 4 10 11 K=3 output : 7 8 9 7 9 10 7 10 11 8 9 10 8 10 11 desired complexity : O(k*n*logn) -- 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.