Removing Duplicates in O(k) time

Discussion in 'C' started by pavankumar.thati, May 20, 2010.

  1. pavankumar.thati

    pavankumar.thati New Member

    Joined:
    Jul 9, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Q An array of size k contains integers between 1 and n. You are given an additional scratch array of size n. Compress the original array by removing duplicates in it. What if k << n?

    ANS : I solved the problem.But i want to solve the problem in O(k) time with out using auxiliary array can any one plz help me out .....
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice