Hi , can anyone tell me how to find the diameter of a set of N points i.e the distance between the 2 most farthest points efficiently.
How to detect duplicates from a large amount of text files?
How to print very large Fibonacci numbers eg fib(1000). My approach: When any one of fib(i-1) or fib(i-2) has more than 12 or 13 digits, partition them into groups of 4 digits and put them in a linked list. fib(i-1) is put in list1, fib(i-2) in list2. Perform the addition of these long numbers and overwrite in list2. Now to find next fib list1 is taken as fib(i-2) and list2 as fib(i-1) and this repeats until we approach the given number and finally the result is in lis...
If the time complexity of an algorithm turns out to be 3^(log n), should we conclude it has exponential running time?
Given a 2 dimensional plane in which there are n points. Give an algorithm to generate the equation of a line that divides the plane such that there are n/2 points on one side and n/2 points on the other.
If I've a string like It is a fine morning, the algorithm has to print "morning fine a is It" and not "gninrom enif a si tI" The algo has to do this in linear time. Can someone help me out in this
Given an integer, find all compositions of the numbers considering order important.Composition of 5 : 1+1+...+1, 1+1+1+2, 2+1+1+1 Modify it to ‘Dont consider order important 1+1+2 is same as 1+2+1.
Given an array A[] of integers of length N, find a sub-array whose sum is a multiple of N.
Given a Linked List. The Linked List is in alternating ascending and descendin orders.
Sort the list efficiently e.g., 10->32->53->42->39->12->10->NULL
The question was asked to me MS written test.
How to find the second shortest path in a graph?
Express the following in terms of Big O, Big Omega or Theta.
n^(1/lg n)
Here ^ is the exponentiation.
merge n sorted array such that resultant array is also sorted.
How to get all substrings of a given string? most efficient algo, not the naive one
How would you design the game "Checkers"?
Which Data Structure is used in Chess game to get the next move?
Given a set of comparable elements, the ceiling of x is the smallest element in the set greater than or equal to x, and the floor is the largest element less than or equal to x. Suppose you have an array of N elements in ascending order. Give an O(log N) algorithm to find the floor and ceiling of x.
Given an integer represented as a binary number, compute the number of 1s ?
RSS feed for this forum
You must log in to post.
Register or log in:
Lost Password?