Re: [algogeeks] Technology for Graphical User Interface on Linux

2014-10-17 Thread Mayur
Not the right forum.. But you can try Qt if licensing isn't a concern. Or GTK+. On Mon, Oct 6, 2014 at 8:03 PM, sagar sindwani sindwani.sa...@gmail.com wrote: Hi all, I am looking for a good tool or language to create graphical user interface in linux environment. Java can be used to

[algogeeks] finding anagrams in a list of words

2012-05-11 Thread mayur
Hi all, I am stuck with a question for a long time...can someone provide the best algorithm for this.. Question).. find all the anagrams in a list of words. The algorithm should be efficient as the list can be very large. -- You received this message because you are subscribed to the Google

[algogeeks] How to design snake and ladder game using OOPS

2011-08-17 Thread mayur
Hi can any one help me, in how to answer these type of questions. Like how do you design Snake and Ladder game, or a Chess Game. What classes you will use, which methods and variables will be private/ public. Its not about coding, its about designing. Please Help -- You received this message

Re: [algogeeks] Re: Reading Huge input from the terminal in least time.

2011-04-21 Thread Mayur
If you're working on Linux then there's asynchronous I/O functions that do well.. http://www.gnu.org/s/libc/manual/html_node/Asynchronous-I_002fO.html#Asynchronous-I_002fO http://www.gnu.org/s/libc/manual/html_node/Asynchronous-I_002fO.html#Asynchronous-I_002fOWindows might have similar

Re: [algogeeks] Re: An interesting question

2011-02-27 Thread Mayur
If the diagonal elements of the matrix are all 0s, then you'd have to set every element in the matrix to 0 (i.e. O(N^2) operations ). I don't think, therefore, that we can do better than O(N^2). The best we can do is to perhaps, make it output sensitive. On Sun, Feb 27, 2011 at 6:14 PM,

Re: [algogeeks] Re: How to print path of a node

2010-09-07 Thread Mayur
Like Adam says, the complexity will depend upon what your input looks like, as also, what exactly is the problem. If you are required to do a search for the keys first, then it's going to be really expensive. If on the other hand, you already have the two pointers, and if you do have the parent

Re: [algogeeks] There is an array of odd and even numbers. Now, sort them in such a way that the top portion of the array contains odd numbers, bottom portion contains even numbers

2010-06-22 Thread Mayur
Rohit's approach put into a typical c++ construct... inline is_odd(int x) { return ((x 1) == 1); } struct new_compare { bool operator () (int i, int j) { bool b_i_odd = is_odd(i); bool b_j_odd = is_odd(j); if ((b_i_odd b_j_odd) || (!b_i_odd !b_j_odd))

Re: [algogeeks] concatenation of 2 circular linked lists

2010-06-11 Thread Mayur
implementation. Freeing up a list on the other hand requires a full traversal, no matter what kind of list it is. That's because each node was allocated separately (that would be the whole point of having a dynamically created list). thanks, mayur On Fri, Jun 11, 2010 at 1:23 PM, Raj N rajn

Re: [algogeeks] Re: binary nos

2010-06-11 Thread Mayur
. Also, N0(p-1) = N0(p-2) + N1(p-2) = N(p-2) from (2) Therefore, (4) reduces to N(p) = N(p-1) + N(p-2) The above, you would recognize as the generative recursive form of the sequence of fibonacci numbers. thanks, mayur On Fri, Jun 11, 2010 at 2:05 PM, Debajyoti Sarma sarma.debajy

Re: [algogeeks] Re: binary nos

2010-06-11 Thread Mayur
Oh! Forgot to mention that the count of the leaves of the tree, gives the number of possible sequences (as required to be determined by the question) On Fri, Jun 11, 2010 at 10:02 PM, Mayur mayurhem...@gmail.com wrote: A more theoretical answer to the question can be the following: Let's try

Re: [algogeeks] Re: array question

2010-06-07 Thread Mayur
@Anand Depending upon the sequence of data in the input, an insertion/search into the (unbalanced) BST will take O(n) time causing the overall complexity to shoot up to O(n^2) for each element counted once. Sourav's approach requires a balanced binary search tree. @Divya.. If you know something

Re: [algogeeks] Maintaining frequency of millions of user

2009-12-09 Thread Mayur
We have a server hit by millions of users. Sever log files contains the user ids of all of them. How do we find the frequency of login of each user. What will the most efficient way to store the users, and access them to find their frequency(The log files are very huge!!) I thought of using B+

[algogeeks] Re: Terms extraction

2008-06-15 Thread Mayur
If the number of articles to do this is more than one, and if space isn't much of a concern, one might considering constructing a trie structure for the dictionary (this would take an O(nT) worst case time where n is the length of the longest word in the dictionary. However, for subsequent uses

[algogeeks] Re: I'm stuck with this problem

2007-10-17 Thread Mayur
Google for connected components... you'll probably land up some method using disjoint set structures and depth-first search... On 10/16/07, Muntasir Azam Khan [EMAIL PROTECTED] wrote: On Oct 14, 10:18 am, Legend [EMAIL PROTECTED] wrote: Suppose that I have some data: 12,30 12,45

[algogeeks] Re: Google Interview Question: find shortest summary containing all key words

2007-09-24 Thread Mayur
Another possibility is to first pre-process the keywords into automaton-like structure (Google for Aho Corasick string matcher), and then use it over the document. This would probably be helpful only if the number of keywords is much smaller than the document itself.. On 9/25/07, daizisheng

[algogeeks] Re: Time complexity

2007-06-12 Thread Mayur
log(log(m)) is defined. = log(log(m)) / log(m) 1 Also sqrt(x), for 0x1 is also in the interval (0, 1) = we have a bound on the O( sqrt(blah..blah.blah..) ) = O(1) Thus, the recurrence reduces to T(m) = T(m/2) + O(1) This happens to be a lot easier to solve.. Thanks, mayur On 6/12/07

[algogeeks] Re: Path finding in map

2007-04-24 Thread Mayur
of the path, or the number of hops), you decide the appropriate search algorithm (which, as mentioned earlier, includes Dijkstra's algo among others). There are some randomized algorithms for faster path-planning ...google for them if you wish... Thanks, Mayur On 4/19/07, Lukas Šalkauskas [EMAIL

[algogeeks] Re: Reading a PDF file

2007-04-24 Thread Mayur
This isn't exactly the list for this question. However, search (google) for PDF reference... should help you get there.. Thanks, mayur On 4/20/07, chitta koushik [EMAIL PROTECTED] wrote: Hi, I want to read a PDF file contents and want to print that in a text file...i.e if a PDF file

[algogeeks] Re: a data structure for phone directory

2007-02-14 Thread Mayur
could also concoct a data-structure that combines the trie and the b-tree approach (insertions would be expensive). Thanks mayur On 2/14/07, Karthik Singaram L [EMAIL PROTECTED] wrote: It does depend on the size of the problem you have in mind. Tries can be expensive for names depending

[algogeeks] Re: time complexity of algorithms

2006-12-15 Thread Mayur
1.) If you're talking about search using a tree with each node having degree 4, then the best-case complexity is indeed O(1). Why, the first node (the root) could be the one that you're looking for. 3.) Yes indeed. Since, your tree doesn't seem to have any branching logic (like a BST does), the

[algogeeks] Re: doubt boss...

2006-05-26 Thread Mayur
When you declare an array int a[3] or whatever, it only says you asked for 3 locations (of type int) to belong to your program. In other words, you asked for 3 locations saying that a is an array variable which can be used to access 3 locations legitimately. However, here's what happens

[algogeeks] Re: Best Algorithm to find a Prime Number

2006-04-29 Thread Mayur
Hi, If you are looking for primality testing, google for the paper Prime is in P. The original paper's by three IIT-Kanpur people. The papers that followed up give the best algorithms for checking primality. If you are looking for prime number generation, look out for sieve methods - especiialy

[algogeeks] Re: Finding the k largest/smallest elements in the array !

2006-04-25 Thread Mayur
Donno if it's the right thing to comment here, but some of you might want to consider what Meggido did for solving some geometric problems - it's called parametric search... do google for it - it's very very interesting. His algorithm simulates a parallel algorithm on a serial system, still

[algogeeks] Re: I guess, It is a tough one!!! Lets see who solves this

2006-04-03 Thread Mayur
I donno if it's so tough... Maybe I'm wrong.! Or I may have missed on something. Here's my attempt. We have a0 = a1 = ... = an and b0 = b1 = ... = bn Therfore, the largest ai + bj would be (an + bn) 1: count - 0 2: i - n, j - n 2: while count n 3: select ai + bj. 4: if a(i-1) b(j-1) //

[algogeeks] Re: WOW!!! see the real image of muhammad

2006-03-09 Thread Mayur
And to add to Adak's philiosophy - this list is strictly (forgive my impudence) for technical discussion (and in my personal opinion, it is just plain evil to attempt to cause sparks by hurting others' religious sentiments). Please keep such topics for lists that allow religious propaganda.On

[algogeeks] Re: Return visible lines

2006-02-22 Thread Mayur
, and map them back to the primal plane as lines. Take the pair-wise intersection points, in the same order, and then you get your upper envelope. sincerely, mayur On 2/23/06, kool_guy [EMAIL PROTECTED] wrote: You are given n nonvertical lines in the plane, labeled L1, L2, ...,Ln,with the ith line

[algogeeks] Re: BEST SORTING TECHNIQUE

2006-02-13 Thread Mayur
Look at introspective sorting - a rather old algorithm. And look at the book Programming Pearls - (J. Bentley). There is a chapter on Data structures programs. And apologies if you already knew about both things (in which case, the above two sentences would sound offensive). sincerely, mayur

[algogeeks] Re: Automaton

2006-01-17 Thread Mayur
How about the language consisting of all the odd numbers. The binary of all odd numbers would be (0+1)*1, which is regular. I don't think, in base 3, you could represent it in a regular _expression_. I am not good at proofs - maybe you can try and get it. enjoy madi mayurOn 1/17/06, pramod [EMAIL

[algogeeks] Re: FSM generation

2006-01-06 Thread Mayur
Google for Aho-Corasick string matching.On 1/6/06, rajiv krishnan [EMAIL PROTECTED] wrote: i want an algo for designing a finite automata detecting multiple patterns in an input string

[algogeeks] Re: Hard mathematical function

2005-12-24 Thread Mayur
/~oded/frag.html which has fragments from one of the most celebrated cryptography book - there's a chapter on one-way function which is available in postscript. good luck mayur On 12/24/05, Gene [EMAIL PROTECTED] wrote: Any encription algorithm y = E(x) takes a string x to a new string y,which

[algogeeks] Re: towers of hannoi

2005-11-25 Thread Mayur
Hi, On these same lines there are a lot of variants - could someone show me how to solve them. (I tried for a short time but lost my patience soon). Variant 1. Directional TOH - the discs can be moved in only one direction - src-aux, aux-dest, dest-sec. How many moves are required to move N