Given a sequenceSofnelements, on which a total order relation is defined,
describe an efficient method for determining whether there are two
equal elements inS. What is the running time of your method?
LetSbe a sequence ofnelements on which a total order relation is defined.
Recall that aninversioninSis a pair of elementsxandysuch
thatxappears beforeyinSbutx>y. Describe an algorithm running in
O(nlogn) time for determining thenumberof inversions inS.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here