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
http://geeksforgeeks.org/
On Jun 8, 4:07 pm, coder dumca coder.du...@gmail.com 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
I need some more books specialy on algo ds and puzzles
On Wed, Jun 8, 2011 at 4:07 AM, coder dumca coder.du...@gmail.com 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
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 coder.du...@gmail.com wrote:
I need some more books specialy on algo ds and puzzles
On Wed, Jun 8, 2011 at 4:07 AM, coder dumca coder.du...@gmail.com
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
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
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
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