I want an algo for finding second highest element in n + log n- 2 comparisons.
The algo is first find the highest number and then highest among the
number which get defeated during tournament.
(details in corment).
Can anyone do code implemenation for this one.
Thanks
Nagendra
1/2
On Thu, Sep 10, 2009 at 10:51 PM, ankur aggarwal
ankur.mast@gmail.com wrote:
crazy man in the airplane
A line of 100 airline passengers is waiting to board a plane. they each hold
a ticket to one of the 100 seats on that flight. (for convenience, let's say
that the nth passenger in
@all:
There are k baised coins with probabilty of coming head is
P(i) i = 1 to k. If all these coins are tossed together. find the
probabilty of getting i heads ( i = k).
think in Dynamic Programming.
-Nagendra
--~--~-~--~~~---~--~~
You received
@ankur: u r right.
On Mon, Sep 7, 2009 at 9:36 PM, ankur aggarwalankur.mast@gmail.com wrote:
I KNow a sol for given a rand_5() function which generates 0 to 5
and we have to find rand_7() for 0 to 7
could not think about it...
On Mon, Sep 7, 2009 at 9:26 PM, ankur aggarwal
@all:
T(i,j) : denotes the length of longest palindrome with start index
i and end index j index.
T(i,j )=
max {
1 , if i == j;
2+T(i+1,j-1) if x[i] == x[j];
Can anyone recheck and rephrase the question becuase i think it would
be always '0'
On Wed, Sep 2, 2009 at 10:40 AM, Naynnayanish.hi...@gmail.com wrote:
Guys, We are anticipating an algorithm here.
The input would be an array containing 0/1 representing black and
white boxes.
On Sep 1,
@Anil: I will request you to completly explain the things. Not just
write a bit of code. So what is map and how are
you implementing the insert operation.
-- Forwarded message --
From: Anil C R cr.a...@gmail.com
Date: Mon, Aug 31, 2009 at 7:59 PM
Subject:
.
On Sat, Aug 29, 2009 at 11:05 AM, nagendra kumar nagendra@gmail.com
wrote:
Given a n-ary tree of resources arranged hierarchically. A process
needs to lock a resource node in order to use it. But,
A node cannot be locked if any of its descendant or ancestor is
locked.
I
@all: Yah it's 100% true that for 32 white and 32 black we have min
distance at 0.
But question will become difficult when the number of white
and blacks are less than 32.
-Nagendra
On Tue, Sep 1, 2009 at 9:30 PM, Ramaswamy Rramaswam...@gmail.com wrote:
If the white and the black
descendant or ancestor is locked ..
should not be
A node cannot be locked if any of its ancestor is
locked.
On Sat, Aug 29, 2009 at 11:35 PM, nagendra kumar nagendra@gmail.com
wrote:
Given a n-ary tree of resources arranged hierarchically. A process
needs to lock a resource
What ever you have just post here !
On Sun, Aug 30, 2009 at 5:08 PM, Nagendra Kumarnagendra@gmail.com wrote:
Given a set S of n distinct numbers and a positive integer k = n.
Determine the k numbers in S that are closest to the median of S.
Find an O(n) algorithm
; // Unlock the Node
node *prevChild=m;
m=m-parent;
while(m)
{
m-LockCount--;
prevChild=m;
m=m-parent;
}
}
Thanks,
Priya
On Sat, Aug 29, 2009 at 11:35 PM, nagendra kumar
nagendra@gmail.comwrote:
Given a n-ary tree of resources
Write a method to print all valid anagrams of a string
-Nagendra
--~--~-~--~~~---~--~~
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
@Anil: Dictionary is given to you. For each string t in array
u = sort(t).
if(s == u)
print (t).
If dictionary has
result(which
basically corresponds to elements with odd frequency).
_dufus
On Aug 23, 8:44 am, Nagendra Kumar nagendra@gmail.com wrote:
How are u doing with xor. Can u post ur thought here.
Thanks
Nagendra
On Sun, Aug 23, 2009 at 2:07 AM, Dufusrahul.dev.si...@gmail.com wrote:
We can
Given an array of integers,Print the integers whose appareance are in
odd times.
Need not worry abt order while printing the output.
Need Algotithm in o(n) time complexity.
Need efficient space complexity.
--~--~-~--~~~---~--~~
You received this message because
might come up with a better algo.
_dufus
On Aug 21, 3:01 pm, nagendra kumar nagendra@gmail.com wrote:
Given an array of integers,Print the integers whose appareance are in
odd times.
Need not worry abt order while printing the output.
Need Algotithm in o(n) time complexity.
Need
How are u doing with xor. Can u post ur thought here.
Thanks
Nagendra
On Sun, Aug 23, 2009 at 2:07 AM, Dufusrahul.dev.si...@gmail.com wrote:
We can count or XOR but I couldnt find any advantage of XORing except
for preventing overflow.
_dufus
On Aug 22, 5:03 pm, Nagendra Kumar nagendra
) is actually possible.
_dufus
On Aug 20, 6:41 pm, nagendra kumar nagendra@gmail.com wrote:
How can we find an element in the matrix [n*n] which is sorted row
wise and column wise in O(log n).
--~--~-~--~~~---~--~~
You received this message because you
How can we find an element in the matrix [n*n] which is sorted row
wise and column wise in O(log n).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
20 matches
Mail list logo