Translating recursion to divide and conquer

前端 未结 0 1805
挽巷
挽巷 2020-12-03 07:45

I\'m trying to return the three smallest items in a list. Below is an O(n) solution I\'ve written:

def three_smallest(L):
    # base case
    if (len(L) == 3)         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题