.
--
Gaurav Menghani
--
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
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.
--
Gaurav Menghani
--
You
@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.
--
Gaurav Menghani
--
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.
--
Gaurav Menghani
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.
--
Gaurav Menghani
--
You received
mentioned), and Bottom-up. Search for Bottom-up DP.
--
Gaurav Menghani
--
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
@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.
--
Gaurav Menghani
--
You received this message because you are subscribed to the Google Groups
://groups.google.com/group/algogeeks?hl=en.
--
Gaurav Menghani
--
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
this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Gaurav Menghani
--
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
this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Gaurav Menghani
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post
, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Gaurav Menghani
--
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
.
--
Gaurav Menghani
--
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
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.
--
Gaurav
.
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.
--
Gaurav Menghani
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post
.
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.
--
Gaurav Menghani
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group
.
--
Gaurav Menghani
--
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
Sure.
On Wed, Aug 17, 2011 at 4:33 PM, Nitin Nizhawan
nitin.nizha...@gmail.com wrote:
@Gaurav , if you are able to find any resource that explains the logic of
these algos, please let me know.
On Sat, Aug 13, 2011 at 9:50 AM, Gaurav Menghani gaurav.mengh...@gmail.com
wrote:
Thanks
/algogeeks?hl=en.
--
Gaurav Menghani
--
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.
--
Gaurav Menghani
--
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
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.
--
Gaurav Menghani
--
You received this message because you are subscribed to the Google
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.
--
Gaurav Menghani
--
You
wrote:
lol
On Sat, Aug 13, 2011 at 6:12 PM, Gaurav Menghani
gaurav.mengh...@gmail.com wrote:
http://lmgtfy.com/?q=scanf+float+precision+format
On Sat, Aug 13, 2011 at 5:42 PM, SuDhir mIsHra
sudhir08.mis...@gmail.com wrote:
e g: scanf(%2.4d,a);
--
You received this message because you
anika.jai...@gmail.com wrote:
@gaurav: nyc one ;) how u made this one well?
On Sat, Aug 13, 2011 at 6:14 PM, SANDEEP CHUGH sandeep.aa...@gmail.com
wrote:
lol
On Sat, Aug 13, 2011 at 6:12 PM, Gaurav Menghani
gaurav.mengh...@gmail.com wrote:
http://lmgtfy.com/?q=scanf+float+precision+format
, 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.
--
Gaurav Menghani
--
You received this message because you are subscribed
, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Gaurav Menghani
--
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
...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Gaurav Menghani
--
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 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.
--
Gaurav Menghani
--
You received this message because you
In C++ it is done in the following way:
- Concatenate all strings
- Sort the string
- Use next_permuation
On Thu, Aug 11, 2011 at 7:01 PM, Gaurav Menghani
gaurav.mengh...@gmail.com wrote:
I guess we should learn to google first.
On Thu, Aug 11, 2011 at 5:58 PM, surender sanke surend
answered already, before posting in the said
forum. This question has been answered repeatedly. If you want to
answer all repeated questions, I suggest you take the onus of doing
so.
On Thu, Aug 11, 2011 at 7:01 PM, Gaurav Menghani gaurav.mengh...@gmail.com
wrote:
I guess we should learn to google
they
want. post the answer if you are willing, otherwise just ignore it. Its
better we should see the workability of the group.
Thank you,
Siddharam
On Fri, Aug 12, 2011 at 10:42 AM, Gaurav Menghani
gaurav.mengh...@gmail.com wrote:
On Fri, Aug 12, 2011 at 12:09 AM, siddharam suresh
siddharam
at the the new last position, which is 'l'.
can u pls explain that?
On Fri, Aug 5, 2011 at 2:57 PM, Nitin Nizhawan nitin.nizha...@gmail.com
wrote:
Ok, Thanks
On Fri, Aug 5, 2011 at 2:53 PM, Gaurav Menghani
gaurav.mengh...@gmail.com wrote:
Even if the number of elements is more than two
...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Gaurav Menghani
--
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
Sorry, I was thinking something else.
Code 1 should be faster since arrays are stored in row-major fashion,
the entire row will fit in cache, and accessing sequentially in the
row would be faster because of higher cache hits than Code 2.
On Mon, Aug 8, 2011 at 3:25 PM, Gaurav Menghani
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.
--
Gaurav Menghani
--
You received this message because you are subscribed to the Google
an ordered sequence...just put the
generated no.s in hash table as soon as they are generated...dats it..
then afterwards display that hash table..
Did u get me...?
On 8/7/11, Gaurav Menghani gaurav.mengh...@gmail.com wrote:
We can have a sorted sequence and display them in random order
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.
--
Gaurav
.
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.
--
Gaurav Menghani
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
Also, when using a greedy strategy, it is best when you can PROVE why the
strategy works.
On Sun, Aug 7, 2011 at 10:25 PM, Gaurav Menghani
gaurav.mengh...@gmail.comwrote:
O(n) solution is pretty simple, without using a greedy strategy.
prod[i] denotes product of ith, i+1th and i+2th elements
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.
--
Gaurav
/software_development/postmans_sort/cuj/cuj.htm
On 8/5/11, Gaurav Menghani gaurav.mengh...@gmail.com wrote:
I agree with Dilip. It depends upon what type of input you have at hand.
- Suppose you have an array having a million elements, where the
elements are in the range 1-3, counting sort would be perfect
and
display them randomly, i mean:
Let say a[10] contains all the random no.s , map all the 10 indexes to
a hash table and then display the arrays with the hashed index...
I think it may work...
what say..?
On 8/5/11, Gaurav Menghani gaurav.mengh...@gmail.com wrote:
1. Get a good seed.
2
('-');
for(int i=0;ialphabet.size();i++)
{
s[l]=alphabet[i];
backtrack(s,l+1);
}
}
--
Gaurav Menghani
--
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
it again..
On Fri, Aug 5, 2011 at 12:32 PM, Gaurav Menghani gaurav.mengh...@gmail.com
wrote:
On Fri, Aug 5, 2011 at 12:20 PM, Kamakshii Aggarwal
kamakshi...@gmail.com wrote:
given a set of letters and a length N, produce all possible output.(Not
permutation). For example, give the letter
()
{
maxlen=3;
alphabet=op;
backtrack(,0);
return 0;
}
On Fri, Aug 5, 2011 at 12:42 PM, Kamakshii Aggarwal
kamakshi...@gmail.com wrote:
@gaurav:i could not understand ur sol.can u explain it again..
On Fri, Aug 5, 2011 at 12:32 PM, Gaurav Menghani gaurav.mengh...@gmail.com
wrote:
On Fri, Aug
...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Gaurav Menghani
--
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
'};
int numchars =sizeof(chars)/sizeof(char);
int N=3;
generate(numchars,chars,N);
}
On Fri, Aug 5, 2011 at 12:58 PM, Gaurav Menghani
gaurav.mengh...@gmail.com wrote:
An Implementation:
#includeiostream
#includestring
using namespace std;
string alphabet;
int maxlen;
void backtrack(string
','o'};
int numchars =sizeof(chars)/sizeof(char);
int N=3;
generate(numchars,chars,N);
}
On Fri, Aug 5, 2011 at 12:58 PM, Gaurav Menghani
gaurav.mengh...@gmail.com wrote:
An Implementation:
#includeiostream
#includestring
using namespace std;
string alphabet;
int maxlen;
void
:
@Varun I think it can be done using bits, if input character set has only
two elements. Or could u plz explain?
On Fri, Aug 5, 2011 at 2:29 PM, Varun Jakhoria varunjakho...@gmail.com
wrote:
I think it can be done using bitwise ANDing with a mask
On Fri, Aug 5, 2011 at 12:58 PM, Gaurav Menghani
to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Gaurav Menghani
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks
the theory about PRNGs and LFSRs, all of them
repeat.
On Fri, Aug 5, 2011 at 7:14 PM, payel roy smithpa...@gmail.com wrote:
How do you guarantee termination of your algorithm if duplication occurs ??
On 5 August 2011 18:25, Gaurav Menghani gaurav.mengh...@gmail.com wrote:
You might want to read
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.
--
Gaurav Menghani
--
You received
polynomial-time algorithm for this problem. If
you think you have a greedy solution to this problem, think again. The DP
solution is also, 'pseudo-polynomial-time'
[0] http://en.wikipedia.org/wiki/Partition_problem
--
Gaurav Menghani
--
You received this message because you are subscribed to the Google
On Thu, Aug 4, 2011 at 7:42 PM, Gaurav Menghani
gaurav.mengh...@gmail.com wrote:
On Thu, Aug 4, 2011 at 7:37 PM, saurabh singh saurab...@gmail.com wrote:
Its a classical 0/1 knapsack problem which can be implemented either as a
greedy solution or dp
It has been stated earlier
in reasonable time. When you increase the set size, the time
taken increases.
--
Gaurav Menghani
Stony Brook 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
@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.
--
Gaurav Menghani
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
Then that has to be mentioned in the question. Premature optimization
is the root of all evil, in the words of Don Knuth.
On Fri, Aug 5, 2011 at 9:38 AM, Anand Shastri anand.shastr...@gmail.com wrote:
what if new task gets added every time.
On Thu, Aug 4, 2011 at 8:24 PM, Gaurav Menghani
)
time.
Segment tree [0] is what you are looking for.
[0]
http://www.topcoder.com/tc?module=Staticd1=tutorialsd2=lowestCommonAncestor
--
Gaurav Menghani
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email
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.
--
Gaurav Menghani
--
You received
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.
--
Gaurav Menghani
--
You received
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.
--
Gaurav Menghani
--
You received this message because you
On Aug 1, 6:25 pm, Deepak deepakthegi...@gmail.com wrote:
Given an array of elements 'n'. some kn elements are replaced by
elements such that the repalced elements are n. with o(n) find the
missing elements, without wasting any extra memory.
I think you did not phrase the question correctly.
61 matches
Mail list logo