Can you please tell the kind of algos that will be asked for the interview
and what all subjects to focus for?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
Can you please give the algo of solving it in O(nlogn)
On Friday, 27 July 2012 15:35:24 UTC+5:30, Navin Kumar wrote:
Given array of integers (0 or +ve or -ve value) find two elements having
minimum difference in their absolute values.
e.g. Input {10 , -2, 4, 9,-20,17,-8,14,12)
output {9,-8}
and just for confirming.. will the algo for O(n2) be:
// uses kind of selection sort technique
mindiff = abs(a[1]-a[2]) //take a default min value
for i= 1 to n
for j= 1 to n
if i==j // same no.
continue
if abs(a[i]-a[j]) mindiff // if difference of some other