There are a lot of simplifications you can make to get this problem
down to a manageable size.
First of all, notice that each of the four buttons inverts itsself. So
if you press it twice, you are back to the initial state. The order of
button pushes does not matter. Any order of the same button p
http://geeksforgeeks.org/
On Jun 8, 4:07 pm, coder dumca wrote:
> I am last year student preparing for placements
>
> can any one give some ebooks on data structure, algo etc. like beofre some
> time , some one posted a book " how to crack the coding interview" that was
> an awesome book than
Try placementsindia.blogspot.com , it has a good collection of
problems specific to placements.
On Thu, Jun 9, 2011 at 12:23 PM, coder dumca wrote:
> I need some more books specialy on algo ds and puzzles
>
> On Wed, Jun 8, 2011 at 4:07 AM, coder dumca wrote:
>>
>> I am last year student prepar
I need some more books specialy on algo ds and puzzles
On Wed, Jun 8, 2011 at 4:07 AM, coder dumca wrote:
> I am last year student preparing for placements
>
> can any one give some ebooks on data structure, algo etc. like beofre
> some time , some one posted a book " how to crack the coding
On 6/13/07, Phanisekhar B V <[EMAIL PROTECTED]> wrote:
> For the second question its not possible to do it in O(log n), as u need
> O(n) time to read the elements itself.
> You need to check your second question. There might be some constraints
> associated with the arrays.
>
That's like saying y
Can you please tell me what type of constraint is associated with arrays
Also if i m not wrong to calculate the median of any sets of numbers . The
sets of no. should be sorted . So i think it;'s not beneficial to calculate
the median of unsorted sets of array.
It will be good if more detaile
Hi Alkispe,
I think it is feasible to solve the 2nd problem in O(lgn) on the
condition that the two arrays are sorted.
Please let me know the algorithm if the problem can be solved for two
unsorted arrays using O(lgn). :-)
Thanks!
On Jun 13, 2:27 pm, "Phanisekhar B V" <[EMAIL PROTECTED]> wrot
For the second question its not possible to do it in O(log n), as u need
O(n) time to read the elements itself.
You need to check your second question. There might be some constraints
associated with the arrays.
On 5/19/07, dor <[EMAIL PROTECTED]> wrote:
>
>
> 1. You can certainly do it in O(n lo
A. for finding the repeated elements in an array.
1. make a loop that goes thru from first to last element.
store the first array element into new array narr.
compare the array element from narr with new array element of step
1.
if array element from step 1 is s
1. You can certainly do it in O(n log(n)) without any additional
memory. Sometimes you can bring the complexity down using additional
memory (i.e., hashing).
2. O(n log(n)) is trivial (sorting). There is a linear time algorithm
for finding the median (I call it "median of the medians", I don't
kn
Hi,
You can try a similar technique...
Start at an arbitrary endpoint,
Set the number of open chords to zero,
Set the number of intersections to zero
Traverse the endpoints along the circle in one direction (made
possible by sorting radially)
{
If the endpoint is one that closes a
Hi,
suppose the chords are represented as (x1,y1) (x2,y2) and x1 > x2
then sort the chords according to x1 - o(nlogn)
then for each chords check with how many chords it intersects
(consider only x values),
logn for each key so another o(nlogn)
repeat the procedure with replacing x by y
12 matches
Mail list logo