4 ms·
If it iterates over every item in the list then it’s O(n) time
by reidjs 4y ago
If it iterates over every item in the list then it’s O(n) time
- drexlspivey 4y agoJust delete the whole list
- willcipriano 4y agoWhy would they ask to sort it if it is already sorted? Deleting the list resolves any out of order items.
- BizarroLand 4y agoBLARG. I knew that but I second guessed myself into getting it wrong. Thanks for the clarification.
- BizarroLand 4y agoI guess you could make a Blitzkrieg multithreaded variation, then it would run in O(Log N) time.