Topic — Add New » Posts Last Poster Freshness
Farthest two points 1 1 year

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? 3 1 year

How to detect duplicates from a large amount of text files?

Print large Fibonacci numbers 1 1 year

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...

A time complexity question 2 ankit.jhil 1 year

If the time complexity of an algorithm turns out to be 3^(log n), should we conclude it has exponential running time?

Divide a Plane into Two Equal halves 2 1 year

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.

Print the string in reverse order not revstr 2 1 year

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

Find compositions 1 kapil 1 year

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.

Find a sub-array 2 1 year

Given an array A[] of integers of length N, find a sub-array whose sum is a multiple of N.

Sort a special linked list 4 1 year

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.

Second shortest path 1 1 year

How to find the second shortest path in a graph?

A Big O notation question 2 2 years

Express the following in terms of Big O, Big Omega or Theta.

n^(1/lg n)

Here ^ is the exponentiation.

merging n sorted array 4 2 years

merge n sorted array such that resultant array is also sorted.

Strings 2 Shekhu 2 years

How to get all substrings of a given string? most efficient algo, not the naive one

Checkers game 1 2 years

How would you design the game "Checkers"?

Next move in chess 1 Shekhu 2 years

Which Data Structure is used in Chess game to get the next move?

[closed] Algorithm to find floor and ceiling in a set 3 geeksforgeeks 2 years

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 ? 2 2 years

Given an integer represented as a binary number, compute the number of 1s ?