Re: [algogeeks] Re: All valid dictionary words must be found and printed.
if we use brute force we have sum(n + n-1 + .. n-r .. + 1) = n*n words which are to be checked. Therefore O(n-sq). now, if i can use a dictionary interface to reject some prefix altogether, than i need not check some words, o/w with the given interface we cannot do it any better than quadratic time. On Tue, Oct 4, 2011 at 6:23 PM, Navneet wrote: > What is the source of this question? > > On Sep 20, 4:49 am, Ankur Garg wrote: > > nice find bhanu..though i didnt get much :P on first read :D :D > > > > On Tue, Sep 20, 2011 at 4:34 AM, Bhanu Kishore >wrote: > > > > > > > > > > > > > > > > > See this algorithm: > > >http://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_string_matching_alg. > .. > > > > > -- > > > 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. > > -- Nice Day Abhishek Sharma Bachelor of Technology IIT Kanpur (2009) -- 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: Sudoku
Hi Don, How is your method better than backtracking? i hope you are implementing a sudoku solver.. Let me know. Regds. On Tue, Oct 4, 2011 at 10:42 PM, Don wrote: > When you say "Simulate" Sudoku, do you mean solve a given Sudoku > problem? > > Here is an overview of how I did that: > > I used an array of 81 integers to represent the board. > Then I built a 27x9 table of all the groups: 9 rows, 9 columns, and 9 > squares. > Then I built a 81x3 map which relates each location on the board to > the 3 groups it belongs to. > I maintain an array of 27 integers called "avail" whose bits indicate > which values are still needed in that group. > > Read in the given values and update avail accordingly. > > Then repeatedly do the following until the problem is solved > For each empty cell > Compute the bitwise AND of the avail values for the 3 groups it > belongs to. > If the AND is zero, no value can go there. Return failure. > If exactly one value can go there, put it there and update the > avail values for the 3 groups > If the loop above did not fill in any cells, then do the following > Loop at each of the 27 groups > For each value missing in that group, count the locations > where it could go > If it could go in exactly one location, put it there > If it cannot go in any location, return failure. > If the neither method above filled in any cells, then do the > following: > Pick the empty cell with the fewest possible values > Try the possible values in that cell until you find one which > allows the puzzle to be completed > > If the puzzle is solvable, this will solve it in a fraction of a > second. > > Don > > On Oct 4, 9:21 am, himanshu kansal > wrote: > > can anybody give me the steps you need to check while writing a > > program to simulate sudoku > > > > i don't want the exact codejust algorithm would me more than > > sufficient. > > > > suggest also the suitable languages for implementing that..VB or > > java or any other > > -- > 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. > > -- Nice Day Abhishek Sharma Bachelor of Technology IIT Kanpur (2009) -- 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] suggestion
well lets face it.90 pc of the posts these days are queries on companies recruiting interview questions etc.even the algorithm questions asked are not strictly algorithmic in nature.only a few people keep giving solutions other just keep doing +1.the point is with over 5000 members its not possible anymore to maintain this group as a quality discussion forum.why not create a seperate group with restricted membership and trying to maintain the quality there.the membership basis can be left on the discretion of admins. On 10/3/11, sunny agrawal wrote: > And About Posting Questions on The Group > It is a humble request to the members of the group (who are reading this > post) that Please Don't Post Question in the subject of the message. > rather put related topic name in the subject, which can give a idea what the > question is about. > > On Mon, Oct 3, 2011 at 8:09 PM, sunny agrawal > wrote: > >> There is a Website that was initiated after the success of its community >> Algorithms on ORKUT >> but if i will post the link here people will start spamming there also :P >> like shady sad :( >> >> People have taken this group from Algorithms Group to >> X_Interview_Questions_Database_Group. >> seriously Bad :( >> >> >> >> >> On Mon, Oct 3, 2011 at 7:54 PM, shady wrote: >> >>> people can't even post questions properly >>> same question being asked again and again, so many coders from Russia, >>> Poland, have stopped participating here :-( >>> all discussions are which company ? what is ctc ? what is asked ? what >>> should i do ? if one gets job and then that person becomes immune :-/ >>> seriously lol >>> >>> >>> On Mon, Oct 3, 2011 at 7:50 PM, Ankur Garg wrote: >>> Nice Idea but for pulling this you need committed people :) On Mon, Oct 3, 2011 at 7:36 PM, sukran dhawan wrote: > Hello guys, > Here is a suggestion.With so much talented people in this group,why > cant > we a website that is similar to geeksforgeeks. > It will be really helpful to others if all the topics are well > organised > in the form of website > This is just a suggestion.just ignore the message if im wrong or u guys > don like the idea > > -- > 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. >>> >> >> >> >> -- >> Sunny Aggrawal >> B.Tech. V year,CSI >> Indian Institute Of Technology,Roorkee >> >> > > > -- > Sunny Aggrawal > B.Tech. V year,CSI > Indian Institute Of Technology,Roorkee > > -- > 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. > > -- Saurabh Singh B.Tech (Computer Science) 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 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: recursion
For a local value with an array type, yes, a fresh array is allocated for each recursive call. In C, C++, and languages with reference semantics like Java and Lisp, array parameters are passed as pointers or references, so no fresh array is allocated. In Pascal, call-by-value parameter arrays _are_ copied into fresh storage for each activation. Ada is an interesting example. It has "IN" parameters that behave like call by value, but since the language does not allow assignment or other ways of changing the value of an IN parameter, an array can be passed by reference "behind the curtain" and you (almost) never know it. (You can invent some sneaky ways of discovery through aliasing, but in normal usage this doesn't come up.) On Oct 1, 8:44 pm, rahul sharma wrote: > as we know in recursion new set of variables are created for every > recurrsive call...if i have array in recursion,then does a new array created > for every recursive call??? -- 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: recursion
All non-static local variables declared in the body of a function are unique to that call of the function. So if you called f(0) void f(int n) { int array[10] = {0}; if (n < 10) { ++array[n]; f(n+1); for(int i = 0; i < 10; ++i) printf("%d ", array[i]); printf("\n"); } } It will print 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 Showing that each increment affected the local instance of the array. Don On Oct 1, 1:44 pm, rahul sharma wrote: > as we know in recursion new set of variables are created for every > recurrsive call...if i have array in recursion,then does a new array created > for every recursive call??? -- 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] Reduce Time Complexity of BST
i have a tree . i will do search is it BST or not if yes then Can we reduce time complexity of BST... http://www.geeksforgeeks.org/archives/3042 -- 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: Sudoku
When you say "Simulate" Sudoku, do you mean solve a given Sudoku problem? Here is an overview of how I did that: I used an array of 81 integers to represent the board. Then I built a 27x9 table of all the groups: 9 rows, 9 columns, and 9 squares. Then I built a 81x3 map which relates each location on the board to the 3 groups it belongs to. I maintain an array of 27 integers called "avail" whose bits indicate which values are still needed in that group. Read in the given values and update avail accordingly. Then repeatedly do the following until the problem is solved For each empty cell Compute the bitwise AND of the avail values for the 3 groups it belongs to. If the AND is zero, no value can go there. Return failure. If exactly one value can go there, put it there and update the avail values for the 3 groups If the loop above did not fill in any cells, then do the following Loop at each of the 27 groups For each value missing in that group, count the locations where it could go If it could go in exactly one location, put it there If it cannot go in any location, return failure. If the neither method above filled in any cells, then do the following: Pick the empty cell with the fewest possible values Try the possible values in that cell until you find one which allows the puzzle to be completed If the puzzle is solvable, this will solve it in a fraction of a second. Don On Oct 4, 9:21 am, himanshu kansal wrote: > can anybody give me the steps you need to check while writing a > program to simulate sudoku > > i don't want the exact codejust algorithm would me more than > sufficient. > > suggest also the suitable languages for implementing that..VB or > java or any other -- 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: rise and fall of power
I also Faced the same problem when i tried this one and when i got to know the mistake it was not very happy :( Use methods powl and log10l instead of pow and log10 and u will get 9 digits of precision :) On Tue, Oct 4, 2011 at 10:21 PM, gaurav yadav wrote: > nk > > 34 9: 117566389 > > 23 8: 20880467 > > 92 9: 466101087 > > 1997: 2963208 > > 234232 9: 943982129 > > 3476566 9: 226270832 > > 56999 9: 349261536 > > 9 9: 367879441 > > 567891234 9: 191465113 > > 457474575 9: 278660968 > > > (got these from the comments section.) > > -- > 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. > -- Sunny Aggrawal B.Tech. V year,CSI Indian Institute Of Technology,Roorkee -- 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: best way to learn data structure
join any coding sites, like codechef,spoj,topcoder start coding regularly -- 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] codechef mixtures problem
the above question is similar to matrix-chain multiplication on page number -370,dynamic programming chapter,Introduction to Algorithms,t h cormen,leiserson,rivest,stein -- 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: rise and fall of power
nk 34 9: 117566389 23 8: 20880467 92 9: 466101087 1997: 2963208 234232 9: 943982129 3476566 9: 226270832 56999 9: 349261536 9 9: 367879441 567891234 9: 191465113 457474575 9: 278660968 (got these from the comments section.) -- 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: best way to learn data structure
http://www.stanford.edu/class/cs106x/ http://see.stanford.edu/see/courseinfo.aspx?coll=11f4f422-5670-4b4c-889c-008262e09e4e Awesome You need to have Visual Studio 2005 On Tue, Oct 4, 2011 at 10:14 PM, shady wrote: > there is nothing like best book... which covers all concepts... books are > there just to provide basics... you have to think on your own after that. > > > On Tue, Oct 4, 2011 at 10:08 PM, SUDHIR RAHEJA < > raheja.sudhirah...@gmail.com> wrote: > >> me too..also want to know how do i start with data structues...which book >> is the best which covers almost every concept?? >> >> -- >> 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: best way to learn data structure
there is nothing like best book... which covers all concepts... books are there just to provide basics... you have to think on your own after that. On Tue, Oct 4, 2011 at 10:08 PM, SUDHIR RAHEJA wrote: > me too..also want to know how do i start with data structues...which book > is the best which covers almost every concept?? > > -- > 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: rise and fall of power
I am using following statements to print the first... scanf("%lf%lf",&n,&k); double v = n*log10(n); double dummy; double ff = modf(v,&dummy); double val = floor(pow(10.0,ff+k-1)); printf("%.0f",val); this code works fine when for big values of n like n=234232 , k=9 i get value=943982129 but for even bigger numbers like n=457474575 ,k=9 i get value =278661176 which is not correct,i should get value=278660968 how to make above code produce more precise results... -- 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: best way to learn data structure
me too..also want to know how do i start with data structues...which book is the best which covers almost every concept?? -- 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] Sudoku
I think that "Quantum Neural Network" is a good choice for sudoku. You can find some of paper about it at scholar.google.com. I implemented it by Java and it worked fine :) On Oct 4, 2011, at 11:21 PM, himanshu kansal wrote: > can anybody give me the steps you need to check while writing a > program to simulate sudoku > > i don't want the exact codejust algorithm would me more than > sufficient. > > suggest also the suitable languages for implementing that..VB or > java or any other > > -- > 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. > - Nguyễn Gia グエン・ザー Link Group - Tokuda Laboratory Faculty of Environment and Information Studies Shonan Fujisawa Campus - Keio University -- 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: My symantec interview experiences
Thanks. and congress... -- 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] My symantec interview experiences
Hope it will be useful :) -- 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. Symantec Interview experiences_siva.docx Description: application/vnd.openxmlformats-officedocument.wordprocessingml.document
[algogeeks] Sudoku
can anybody give me the steps you need to check while writing a program to simulate sudoku i don't want the exact codejust algorithm would me more than sufficient. suggest also the suitable languages for implementing that..VB or java or any other -- 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]
This is the link for the book *http://www.4shared.com/document/_Y7p3MLT/Head_First_Servlets_and_JSP.html* -- 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: All valid dictionary words must be found and printed.
What is the source of this question? On Sep 20, 4:49 am, Ankur Garg wrote: > nice find bhanu..though i didnt get much :P on first read :D :D > > On Tue, Sep 20, 2011 at 4:34 AM, Bhanu Kishore > wrote: > > > > > > > > > See this algorithm: > >http://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_string_matching_alg... > > > -- > > 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] Citrix Interview Questions ???
hi all , can anyone pls share citrix interview questions ... thanks raju -- 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] Tree Question
check this(considering valid input) http://www.ideone.com/Nuhil On Tue, Oct 4, 2011 at 3:36 PM, Dheeraj Sharma wrote: > yeah..but am looking for code..that takes the input...as string of > (A(B(E(K,L),F),D(H(M,I),J))) > and returns head of tree.. > > > On Tue, Oct 4, 2011 at 2:11 PM, Raghav Garg wrote: > >> *you have to check for the braces where they have been used..in comman >> brace that means they are on same level..i am providing answer to your >> problem in attached file.. >> check that out.. >> >> *Raghav garg >> >> >> >> On Tue, Oct 4, 2011 at 1:53 PM, Dheeraj Sharma < >> dheerajsharma1...@gmail.com> wrote: >> >>> 1.How to construct a tree from the list representation >>> for ex.- construct tree from (A(B(E(K,L),F),D(H(M,I),J))) >>> the tree would be binary >>> the structure of the node would be >>> >>> struct node{ >>> int data; >>> struct node *left,*right; >>> }; >>> >>> 2.Given a binary tree..give its list representaion..(reverse of above >>> question) >>> >>> -- >>> *Dheeraj Sharma* >>> >>> >>> -- >>> 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. >> > > > > -- > *Dheeraj Sharma* > > > -- > 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: constant
doesnt work in dev cpp On Tue, Oct 4, 2011 at 4:22 PM, prajon wrote: > > main() > {const int a=123; > printf("%d",a); > *(int *)&a=345; > printf("%d",a); > } > On Oct 4, 3:48 pm, prajon wrote: > > can u change and if yes how to change value of constant variable? > > -- > 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* -- 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] Amazon Ques
Find out the smallest segment in a document containing all the given words. Desired Complexity is O nlogK ..n is the total no of words in the document and k is the number of input words -- 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] Waiting list in Qualcomm
Guys Qualcomm came to our college for internship selection(May-July 2012).They selected 3 guys and me and 1 guy in waiting listThey are saying that they would inform about the confirmation on next year mayIs it worth waiting ... Note: I am not from IIT, IISc, IIM They said usually they would select from the above colleges -- 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: constant
main() {const int a=123; printf("%d",a); *(int *)&a=345; printf("%d",a); } On Oct 4, 3:48 pm, prajon wrote: > can u change and if yes how to change value of constant variable? -- 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] constant
can u change and if yes how to change value of constant variable? -- 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] Tree Question
yeah..but am looking for code..that takes the input...as string of (A(B(E(K,L),F),D(H(M,I),J))) and returns head of tree.. On Tue, Oct 4, 2011 at 2:11 PM, Raghav Garg wrote: > *you have to check for the braces where they have been used..in comman > brace that means they are on same level..i am providing answer to your > problem in attached file.. > check that out.. > > *Raghav garg > > > > On Tue, Oct 4, 2011 at 1:53 PM, Dheeraj Sharma < > dheerajsharma1...@gmail.com> wrote: > >> 1.How to construct a tree from the list representation >> for ex.- construct tree from (A(B(E(K,L),F),D(H(M,I),J))) >> the tree would be binary >> the structure of the node would be >> >> struct node{ >> int data; >> struct node *left,*right; >> }; >> >> 2.Given a binary tree..give its list representaion..(reverse of above >> question) >> >> -- >> *Dheeraj Sharma* >> >> >> -- >> 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. > -- *Dheeraj Sharma* -- 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: best way to learn data structure
*i am presently in 3rd year..i have studied data structure in 1st year..but i am not good in that.. *Raghav garg On Tue, Oct 4, 2011 at 2:52 PM, anshu mishra wrote: > In which year you are now. May i can give you some idea. > > -- > 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: best way to learn data structure
In which year you are now. May i can give you some idea. -- 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: best way to learn data structure
Hey Raghav, No methods are worst or best. Just go through any book you have and try the atleast 5 or 6 problems of various difficulty level based on that data structure. Try to think about the functionality of the data structure, so that you can implement it in various situations or use it in different ways. -- 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/-/1V_bOqlY3T0J. 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] best way to learn data structure
*hello guyz.. can anyone suggest me the best book or tutorials to learn data structure.. *Raghav garg -- 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] Tree Question
*you have to check for the braces where they have been used..in comman brace that means they are on same level..i am providing answer to your problem in attached file.. check that out.. *Raghav garg On Tue, Oct 4, 2011 at 1:53 PM, Dheeraj Sharma wrote: > 1.How to construct a tree from the list representation > for ex.- construct tree from (A(B(E(K,L),F),D(H(M,I),J))) > the tree would be binary > the structure of the node would be > > struct node{ > int data; > struct node *left,*right; > }; > > 2.Given a binary tree..give its list representaion..(reverse of above > question) > > -- > *Dheeraj Sharma* > > > -- > 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: Array Problem??
int count(int x, int tree[], int s, int e, int n) { tree[n]++; if (s==e) return 0; int cnt = 0; int mid = (s+e)/2; if (mid < x) return tree[2*n+1]+count(x, tree, mid+1, e, 2*n+2); else return count(x, tree, s, mid, 2*n+1); } main() { for(i=n-1;i>=0; i--) { sol[i] = insert(ar[i], tree, 0, n-1, 0) } } -- 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] Tree Question
1.How to construct a tree from the list representation for ex.- construct tree from (A(B(E(K,L),F),D(H(M,I),J))) the tree would be binary the structure of the node would be struct node{ int data; struct node *left,*right; }; 2.Given a binary tree..give its list representaion..(reverse of above question) -- *Dheeraj Sharma* -- 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]
anybody having HeadFirst's JSP SERVLET ebook... -- 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] codechef mixtures problem
Hi All, Can someone explain the below problem's solution : http://www.codechef.com/problems/MIXTURES I have been struggling to solve DP problems and am not able to think clearly in problems like the one mentioned. Kindly help me to understand DP by providing some useful links. -- Regards, Shachindra A C -- 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] New Group For Practicing and Learning Efficient Ways of Coding
ya..great idea..if it works out well,it'll really be awesome! :) On 10/4/11, vishwa wrote: > i do agree with rahul nice idea.. will work ...going to be great > > On Tue, Oct 4, 2011 at 11:08 AM, Rahul Verma > wrote: > >> Hey, >> >> I have a suggestion that why we don't have a discussion on some topic for >> full one week and after that we can discuss problems from various >> programming sites and discuss the best solution of the problems.. >> >> -- >> 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/-/S3FSxSWlnJAJ. >> >> 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: rise and fall of power
we have to find X^N let it would be N YlogX=log(N) antiLog(YlogX)=N antilog for base 10 is power of 10 so 10^(YlogX)=N and if we want to find 3^5 pow(10,5log3)---> pow(10,2.3856062735)=243 and if u want to find first 2 digits pow(10,(2.3856062735-1))=24.3=24 On Tue, Oct 4, 2011 at 1:46 AM, sunny agrawal wrote: > For Last K Gene has posted the right Approach. > For First K > Hint : Logarithms log(N^N) = NlgN > > On Tue, Oct 4, 2011 at 1:14 AM, Gene wrote: > >> I have not done this, so I'm not sure. But there are some tricks. >> >> You can first break up the computation to exploit repeated squaring. >> Rather than n-1 multiplications, you can get away with log_2 n by >> computing >> >> n_1 = n^2 >> n_2 = n_1^2 >> n_3 = n_2^2 >> so that n_i = n^{2^i} >> for i=1..N where n_N <= n and n_{N+1} > n >> >> Let b_i be the i'th bit of n. >> >> Then n^n = product_{ i | b_i = 1 } ( n_i ) >> >> Now as you say you can't afford to do the full multiply. So you'll >> need two arbitrary precision multiplication algorithms keeping k >> digits of precision each. The first is easy. Compute n^n as above >> modulo 10^k (always throwing away higher order digits) to get the last >> k digits. >> >> The high order digits is the tricky part. I think the basic idea is >> to implement floating point yourself. I.e. keep k+some extra digits >> of mantissa plus an exponent to show where the decimal place is. The >> problem is you always need to keep enough extra digits beyond k to be >> sure rounding up won't affect to top k. There should be simple >> algorithm to determine when you can stop. >> >> Or you can take a chance and count on the fact that the probability of >> carry out is limited for each digit, so with about 30 extra digits the >> chances are pretty close to zero. >> >> >> On Oct 3, 8:18 pm, g4ur4v wrote: >> > can anyone please help me on how to approach this problem=> >> http://www.codechef.com/problems/MARCHA4 >> >> -- >> 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. >> >> > > > -- > Sunny Aggrawal > B.Tech. V year,CSI > Indian Institute Of Technology,Roorkee > > > -- > 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. > -- AMRIT -- 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.