The Artist
BAN USERdoesn't matter as you know that the other parts are equal and you will be comparing one of the unequal group with them to just eliminate one more group in the second step
- The Artist October 23, 2012simple at 6:50 minute hand will be at 10 and the hour hand would have moved 50/60 parts ahead of 6 ie it will be at 6 5/6. Now 360 degrees = 12 parts then 10 - 6 5/6 parts = (360/12) * (19/6) = 95 degrees.
- The Artist October 23, 2012Area of a triangle = 1/2 * base * height. divide the base (any side) into n equal length parts (where n is the number of equal area triangle that you want) Join the opposite vertex with each part and you get your triangles.
- The Artist October 23, 2012Assuming the weighing pan is a physical balance and the problem is to identify the fake ball (funnily enough the question doesn't say anything :(), it can be done in 3 measurements using the divide and conquer philosophy :P. Divide the balls into four groups of two balls each say A, B, C, D. Take group A and B and place them on the two sides of the scale. If they are equal in mass then the fake ball is in C or D else it is in A or B. Say they are equal. Now take group C on one side and A (or B) on the other side. If they are again equal then the fake ball is in D otherwise in C. Now take one of the ball from the fake ball group and have it measured with one of the balls from non fake groups. if they are again equal then the other ball is fake otherwise this one.
- The Artist October 23, 201295 degrees
- The Artist October 23, 2012simple count sort problem
- The Artist October 22, 2012yeah...simple count sort algorithm
- The Artist October 22, 2012it works but it doesn't satisfy the constant criterion, only solution that i can think of currently in that case is maintain a dictionary with key the original list node pointers and the value being the corresponding node in the duplicate list. in the first traversal create the duplicates without the random nodes, adding the pair in the dictionary. in the second traversal of the original list, read the random pointer, read its corresponding value from the dictionary and assign that to the random of duplicate
- The Artist October 20, 2012this is a very common Amazon question but they do not mention about original list being unmodifiable but it is implied that the original list remains intact once you are done with your copy (u can modify intermittently but establish all relationship of the original list). Without modifying the original list i think you need to have a two way list if you dont want to do the messy work of counting node's position from its random node link
- The Artist October 19, 2012it will give some garbage value as the array wasn't initialized. a[0] would be 0
- The Artist October 19, 2012answer will be l1 - [(m/1000 - v)[/A where m = mass of rock, v = volume of rock, A = surface area of water (considering uniform) 1000 = density of water
- The Artist October 16, 2012well i meant displaced
- The Artist October 16, 2012Well when the rock was on boat the amount of water displayed by it was equal to the volume of water equal to rocks mass (Archimedes Principle). When the rock sinked to the bottom the amount of water displayed by it was equivalent to the volume of the rock.
- The Artist October 16, 2012how abt marking the elements in a Marker matrix to keep a track of the elements of the alphabet already used? i hope criss crossing the path is also allowed?
- The Artist September 05, 2011@Victor: The problem statement is very simple. Consider a BST problem where you need to find the kth smallest node in the tree. In this problem, a node in addition to having value, rightchild, leftchild also has an additional attribute NumBelowNodes which stores the total of nodes in the subtree of a given node. this value will help in decreasing the search time from O(nlog n) to O(log n)...i guess. See below the example:
5(5)
/ \
/ \
3(2) 8(1)
/ \ \
2(0) 4(0) 9(0)
k=1 shud return 2
k=2 shud return 3
k=5 shud return 8
and so on.....
Abaghel exactly what i posted...although after you :-)
- The Artist September 02, 2011
can you please elaborate
- The Artist October 23, 2012