Leetcode 169: Majority Element. O(nlogn) is faster than O(n)!?

Published: 11 February 2024
on channel: Teach Me Python
527
15

This could get controversial, but using built-ins might just be better than building your own clever solution even if the clever solution is of a faster time complexity at face value.

(I did test this on my own computer for lists from size 10 to 10000000, and every time built in sort beat out linear for loop.


On this page of the site you can watch the video online Leetcode 169: Majority Element. O(nlogn) is faster than O(n)!? with a duration of hours minute second in good quality, which was uploaded by the user Teach Me Python 11 February 2024, share the link with friends and acquaintances, this video has already been watched 527 times on youtube and it was liked by 15 viewers. Enjoy your viewing!