@harit
if that is d case plz
post d link 4 this ques.
remember if u dont want to discuss these ques,u can any time ignore this
mail ,let others who are not as sharp as u discuss these questions.
PS:this is d ques by amazon in 3rd round of interview
--
You received this message because you are
what is the advantage of using calloc() over malloc() and in which
case i should use that?
--
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
are solutions available for problems in
spoj,uva,codedhef,topcoder,etc.etc.?pls tell me
tnkyou
--
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,
Hello Friend
there are many website of html language but no body so able to clear
the concept of html language .if wanna clear to your concept log on to
www.tutorialized.co.in
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
solution for topcoder all available but not others
On Sun, Jul 11, 2010 at 2:19 AM, venkat kumar svenkatkuma...@gmail.comwrote:
are solutions available for problems in
spoj,uva,codedhef,topcoder,etc.etc.?pls tell me
tnkyou
--
You received this message because you are subscribed to the
Given an array of size n wherein elements keep on increasing
monotically upto a certain location
after which they keep on decreasing monotically, then again keep on
increasing, then decreasing
again and so on. Sort the array in place (ie. using only O(1) extra
memory).
--
You received this
Give a algorithm to remove extra pair of parenthesis
Remove unnecessary from an expression :
1) (((a))) = a
2) (a+b) = a+b
3) (a+b)*c = (a+b)*c
4)(((a+b)*(c+d))+e) = (a+b)*(c+d)+e
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to
given a string find the number of distinct substrings of the string.
ex:
input-
output- 4(a, aa, aaa, )
input-abcd
output-10(a, b, c, d, ab, bc, cd, abc, bcd, abcd)
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this
here is the recursion
http://geeksforgeeks.org/?p=2686
execution:
http://codepad.org/pMszw4Y8
was it difficult to google it
--
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.
Given an histogram.. find out the maximum rectangle in it.. You are
given the histogram as an array of heights of each bar.. find it in
O(n)..
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
thr is no search option there ..
if u can gimme the link that will be good ..
--
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
Given an array of size n.find 2 numbers from array whose difference is
least.
--
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
public class sample
{
const int a;
sample(int constValue):a(constvalue)
{
}
};
On Sun, Jul 11, 2010 at 8:17 AM, UMESH KUMAR kumar.umesh...@gmail.comwrote:
Hello everybody
how to Assign Constant value in Class of C++
Describe : Private,Protected, and Public Area in
I was talking about this approach.
for( left_top_i=0 ; left_top_irow_no ; left_top_i++ )
for( left_top_j=0 ; left_top_jcol_size ; left_top_j++ )
for( bottom_right_i=left_top_i ; bottom_right_irow_size ;
bottom_right_i++ )
for( bottom_right_j=left_top_j ; bottom_right_jrow_size ;
bottom_right_j++
A chess competition in which A is the present champion
B and C are the challengers
Furthermore,following:
• 0.6. = probability that B will Beat C in any match
• 0.5. =probability that A will Beat B in any match
• 0.7. = probability that A will Beat C in any match
B AND C are made to play a
If O(n^3) is permissible, then the following works:
--
If we can find one point that falls on such a line, then it is easy to
find the other points
because the slope between this point and all other points that fall on
this line
Assuming we do not want to remove
brackets from cases like (a+b)+c,
(because strictly speaking, the brackets
here are not required), one algorithm to
remove brackets for given above cases can be:
1) Scan through the string.
2) Increment a counter when '(' is
encountered and decrement it on ')'
3)
I searched Google for it but no luck.
Texts have made references to k-tonic sort but couldn't find
definition.
--
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
Question is not clear to me :(
Can you explain a little more and also give an example if possible?
--
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,
Doesn't the solution without queue look very inefficient?
The tree is being traversed till level n-1 for every Nth level
printing.
Thus if the tree has height h, then h^2 tree traversals are there.
Nodes being accessed at level l (assuming fully balanced tree): 1 + 2
+ 4 + 2^l = 2^(l+1) - 1 which
Although this is question is more a C question than a an algorithm
question, it is in fact a very good question. The calloc function
works very like malloc, but it initializes all its bits to zero. It
has a little more overhead than malloc, because it must write zeros in
the memory, but it could
yeah secod part will be in n^2*k
On Sun, Jul 11, 2010 at 9:36 AM, sharad kumar sharad20073...@gmail.comwrote:
how to do second part
it requires log k matrix multiplication
thus o(n3 log n)
plzz xplain
--
You received this message because you are subscribed to the Google Groups
to do level order traversal u can apply BFS taking root node as a starting
node
u can implement it either in a iterative way or recursive way
On Sun, Jul 11, 2010 at 6:42 PM, harit agarwal agarwalha...@gmail.comwrote:
here is the recursion
http://geeksforgeeks.org/?p=2686
execution:
Given a set T of characters and a string S , find the minimum window
in S which will contain all the characters in T in complexity O(n) .
Constraint : The characters may appear in any order
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To
its easy
suppose the array is 12345 4321 2345 4321
it increases then dcreases then increases and decreases again
first of all in a single scan find the location of decreasing sub-arrays
here it is 5 to 8 and 13-16
and reverse the decreasing array.
so the array becomes
12345 1234 2345 1234
now
Constraint - O(n)
On Sun, Jul 11, 2010 at 9:24 AM, amit amitjaspal...@gmail.com wrote:
Given an array of size n.find 2 numbers from array whose difference is
least.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
sort the numbers ... the numbers with minimum difference will be adjacent
On Sun, Jul 11, 2010 at 9:54 PM, amit amitjaspal...@gmail.com wrote:
Given an array of size n.find 2 numbers from array whose difference is
least.
--
You received this message because you are subscribed to the Google
given a set of numbers
u hve to find the pair which give maximum value if we xor that pair
ex a={1,3,6,7,8,9}
then ans is 15 as 7 xor 8
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
you can use longest common subsequence algorithm to solve it.
http://codepad.org/NDAeIpxR
On Sun, Jul 11, 2010 at 9:32 AM, amit amitjaspal...@gmail.com wrote:
Given a set T of characters and a string S , find the minimum window
in S which will contain all the characters in T in complexity
@souravsain
for input {10,20,30,40,50,23,27};
ur output is coming 10, 20, 23, 27, 40, 30, 50,
which not SORTED array.
On Jul 10, 6:19 pm, souravsain souravs...@gmail.com wrote:
@Jitendra
I have run the code with input given by you and found that it works
well.
Please have a look
30 matches
Mail list logo