shwetank2003819
BAN USER- 0of 0 votes
AnswersThere is a set of 9 students and 3 schools Every school can be alloted atmax 3 students .Every school and student has its coordinates .Now we have to allot student in such a way that the sum of distance from all the student to the school should be minimum.
- shwetank2003819 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 0of 0 votes
AnswersK-Maximum Subarray problem
- shwetank2003819 in India| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer - 0of 0 votes
Answersthere ar two points A and B. The coni is being tossed at A and the outcome is being stored in a string like "HHTHHHHHTTTTT...", where H = Head, T = Tail; Now we have to send this information to point B by using minimum bandwidth?
- shwetank2003819 in India
Do it in minimum space ?| Report Duplicate | Flag | PURGE
InterraIT Software Engineer / Developer - 0of 0 votes
AnswersWrite an algorithm two divide two extremely large numbers, which cannot be stored in an int, long int, float, double etc. Find the remainder and quotient .
- shwetank2003819
Notes:
1. Do not use the subtraction approach .| Report Duplicate | Flag | PURGE
Trilogy Software Engineer / Developer
a solution from my end:
1- Store all the n(n+1)/2 possible subarrays sum in a max heap.
2- Find out the kth max subarray by k delete heap operations.
Time Complexity: O(n2)
I get to know that there is an algorithm of O(n + K) complexity. Can sb please, update me on the same (Logical steps and data structures required)
@Raydena:
Thanks for your comment.
But the graph of facebook contains trillions of users...it would be not efficient to run BFS on whole graph.
Also, how a simple BFS can assure that no other shorter path exist after it ends.
See, every node has its connection and one of which is shortest one(either from person A/Afriends end or Person B/Bfriends end). Also, u have to prevent to go yourself in loops
@Ankit:
You are considering probability of every field separately:
Let say:
We have to find the probability for a particular hour and second field combination in a "DAY"
Required value be: 06:XX:05
Now how many times '0' would be occurred in a day in second's and hour field...how many times '5' and '6' would occur in the second's and hour field respectively.
It depends on scheduler!!!
- shwetank2003819 October 26, 2009
it would be helpful if u plz elaborate ur algorithm with the following example(let say) :
- shwetank2003819 February 28, 2012A = -12, 1, 6, -3, 5, -2
K = 4