Original Post
I just got my first algorithm book - Introduction to algorithms by Thomas H. Cormen - and it's grrrrrreat! However, I'm stuck on two problems in the first chapter :) The first: Describe a O(n lg n) algorithm that given a set of numbers, determine whether there are two numbers in the set that sum to get another given number, x The second: Inversions are defined that in an array if i < j and A > A[j] then (i,j) is an inversion. give an O(n lg n) algorthim that determines the number of inversions in a given array. Thanks alot you all and I really recommend this book to anyone interested in algorithms