0

How to find lexicographical order of an array of N integers(i.e. 1,2,3,...,n) in its permutations in O(n) time?

Ex:- lexicographical order of {2,3,1,4} is 9 in its permutations

asked Oct 8, 2015 at 4:04
2
  • Do you know up front which integers make up the set (i.e. only 1,2,3,4 here)? If they can also be {777, 99999, -8888, 5000000} (which yields the same result), I imagine it will be more difficult. Commented Oct 8, 2015 at 4:18
  • Related: stackoverflow.com/questions/21293906/… stackoverflow.com/questions/7918806/… Commented Oct 8, 2015 at 4:21

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.