idea is to give note of each denomination at least once (if possible).
On Mon, Sep 21, 2009 at 10:59 AM, Shishir Mittal <1987.shis...@gmail.com>wrote:
> Let the denominations be D[] = {1000,500,100},
> and amount be N.
> Let C[] , denotes the count of each denomination.
> for ( i=0 ; i < 2 ; i++)
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
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 line has a ticket f
@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 t
@ankur: u r right.
On Mon, Sep 7, 2009 at 9:36 PM, ankur aggarwal 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
> wrote:
>>
>> Given a ran
is it not finding a cycle in a graph of length 3.
On Sun, Sep 6, 2009 at 9:02 PM, Dufus wrote:
>
> The following approach might work.
> Let K be the maximum degree of a vertex in the graph
> Enumerate each of the n vertex as 1...n
> Enumerate undirected edge between vertex i and j (i.e. i--j
@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];
max(T(i
Can anyone recheck and rephrase the question becuase i think it would
be always '0'
On Wed, Sep 2, 2009 at 10:40 AM, Nayn 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, 8:37 pm, yash wrot
its 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
> wrote:
>>
>> Given a n-ary tree of resources arranged
@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 R wrote:
> If the white and the black squares are not arrange
@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
Date: Mon, Aug 31, 2009 at 7:59 PM
Subject: [algogeeks] Re: String- Anag
l (which is a pretty ugly solution considering what
>> > unlock
>> > > would have to do).
>>
>> > > If we can supplement the tree node with a lock status and pointer to
>> > child
>> > > (only used while unlocking) which is locked we should be
wrote:
> @ Nagendra Kumar
> U can refer Cormen book; it is available...
>
> On Sun, Aug 30, 2009 at 8:06 AM, Dufus wrote:
>>
>> Is it acceptable if I
>> find the median in O(logn) time and then,
>> find k numbers closest to the median in O(k) space and O(n) time
What ever you have just post here !
On Sun, Aug 30, 2009 at 5:08 PM, Nagendra Kumar 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(
NodeToBeLocked)
>> > > {
>> > > if(check(NodeToBeLocked)) // If true, Node is free to be locked
>> > > {
>> > > node *m=NodeToBeLocked;
>> > > m->lock=true;
>> > > node *prevChild=m;
>> > > m=
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
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm G
@Anil: Dictionary is given to you. For each string t in array
u = sort(t).
if(s == u)
print (t).
If dictionary has mi
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 unsubscrib
>> > {
>> > m->LockCount++;
>> > prevChild=m;
>> > m=m->parent;
>> > }
>> > return true;
>> > }
>> > return false; //err.. cannot be locked
>> >
>> > }
>> >
>
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 was supposed to
-> write the structure of node
-> write codes for
-> islock()- returns true if a giv
> basically corresponds to elements with odd frequency).
>
> _dufus
>
>
> On Aug 23, 8:44 am, Nagendra Kumar wrote:
>> How are u doing with xor. Can u post ur thought here.
>>
>> Thanks
>> Nagendra
>>
>>
>>
>> On Sun, Aug 23, 20
How are u doing with xor. Can u post ur thought here.
Thanks
Nagendra
On Sun, Aug 23, 2009 at 2:07 AM, Dufus 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 K
come up with a better algo.
>
> _dufus
>
>
>
>
>
> On Aug 21, 3:01 pm, nagendra kumar 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 Algoti
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 you
actually possible.
>
> _dufus
>
>
>
> On Aug 20, 6:41 pm, nagendra kumar 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 rec
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 algog
26 matches
Mail list logo