Re: [algogeeks]Numbers search in an array

2010-06-18 Thread Ashish Mishra
to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Thanking You Ashish

Re: [algogeeks] MXN matrix

2010-04-30 Thread Ashish Mishra
, Complexity is O(N^4) On 28 April 2010 13:36, Ashish Mishra amishra@gmail.com wrote: you are given a M x N matrix with 0's and 1's find the matrix with largest number of 1, 1. find the largest square matrix with 1's 2. Find the largest rectangular matrix with 1's -- You received

[algogeeks] infy color balls

2010-04-30 Thread Ashish Mishra
One of my friend ask me this n i am bad in P C (will love if smone can provide me a link to learn it though) nyways prob is: there are infy color balls of k different color you are allowed to pick n balls out of those infy(infinite) balls cond is : you must have all k color balls with u

[algogeeks] MXN matrix

2010-04-28 Thread Ashish Mishra
you are given a M x N matrix with 0's and 1's find the matrix with largest number of 1, 1. find the largest square matrix with 1's 2. Find the largest rectangular matrix with 1's -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this

Re: [algogeeks] Build BST from binary tree without extra space

2010-04-28 Thread Ashish Mishra
into bst no need to use extra space u have to just ditach the node from binary tree and attach it in bst. On Wed, Apr 28, 2010 at 1:18 AM, Ashish Mishra amishra@gmail.com wrote: How to build BST from binary tree in place i.e without extra space ?? -- You received this message because

[algogeeks] Build BST from binary tree without extra space

2010-04-27 Thread Ashish Mishra
How to build BST from binary tree in place i.e without extra space ?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to

Re: [algogeeks] Finding all prime less than 10^8

2010-04-14 Thread Ashish Mishra
...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Ashish Mishra http://ashishmishra.weebly.com

Re: [algogeeks] Re: Implement a queue using a stack

2010-04-14 Thread Ashish Mishra
. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Ashish

Re: [algogeeks] efficient backtracking algorithm for the coin changing problem

2010-04-10 Thread Ashish Mishra
y u need backtracking i think it can be done with DP On Sat, Apr 10, 2010 at 9:12 AM, «« ÄÑÜJ »» anujlove...@gmail.com wrote: Need help in designing efficient backtracking algorithm for the coin changing problem. where a1, a2, an are the set of distinct coins types, where each ai is an

Re: [algogeeks] Finding youngest common ancestor of two nodes in a binary tree

2010-04-08 Thread Ashish Mishra
i think u mean lowest commen ancestor? On Wed, Apr 7, 2010 at 10:34 PM, Himanshu Aggarwal lkml.himan...@gmail.comwrote: For a given binary tree, given the root and two node pointers, how can we find their youngest common ancestor. Say the node is like: struct node{ int data;

Re: [algogeeks] Finding youngest common ancestor of two nodes in a binary tree

2010-04-08 Thread Ashish Mishra
yup atul algo is correct (cur_data - node-right) * ( cur_data- node-left) -1 for ancestors On Thu, Apr 8, 2010 at 10:19 AM, atul verma atul.ii...@gmail.com wrote: Its very simple to solve this. Start from root. Compare the value of current node data value to both nodes. 1. if both are

Re: [algogeeks] Re: Largest span of Increasing Pair in an array

2010-03-14 Thread ASHISH MISHRA
@ankur how u can solve it in o(n) i suppose u need atleast o(n lgn) On Sun, Sep 6, 2009 at 2:52 PM, ankur aggarwal ankur.mast@gmail.comwrote: o(n) is the best sol known to me.. On Sun, Sep 6, 2009 at 1:54 PM, Pramod Negi negi.1...@gmail.com wrote: i guess sorting will do the work. any