Have some alg better than O(nlog(k))??


  • 0
    C
        I used three different algs,  multiset , priority_queue, Divide and Conquer. 
        These algs all are O(n log(k)) time complexity, 
        where n is the total number of the all the lists. 
        But!!! why my AC time is about 400ms, 
        but i saw some guys' AC time is 50ms????

  • 1
    U

    one week ago, my k-way merge sort solution got AC time about 47 ms, but today, I run the same code again, it got 400 ms. May the OJ add some new test cases, but I think O(n log(k)) is the best.


  • 0
    C

    thank you! i also agree that O(n log(k)) is the best!


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.