# Given a sorted array find all possible |ai - aj| where ai,aj belongs to Array A. n^2 is obvious. Find a solution in O(N).

## Re: Given a sorted array find all possible |ai - aj| where ai,aj belongs to Array A. n^2 is obvious. Find a solution in O(N).

I think this problem for quite a while, and I don't think it's possible. Are you sure about the problem? Where did you see this problem?

**viterbi**- Posts : 32

Join date : 2011-09-03

## Re: Given a sorted array find all possible |ai - aj| where ai,aj belongs to Array A. n^2 is obvious. Find a solution in O(N).

I saw this problem in MITBBS, also not sure about the time complexity it requires.

viterbi wrote:I think this problem for quite a while, and I don't think it's possible. Are you sure about the problem? Where did you see this problem?

**Admin**- Admin
- Posts : 131

Join date : 2011-08-16

Similar topics

» How to find out a IP address via email

» Garage find Suburban

» Why do I find it so funny...

» How to Find an Agent

» where to find rafia

» Garage find Suburban

» Why do I find it so funny...

» How to Find an Agent

» where to find rafia

Page

**1**of**1****Permissions in this forum:**

**cannot**reply to topics in this forum