Big-O Notation học khám phá phức tạp thời gian trong code. Bài viết cung cấp kiến thức nền tảng về phân tích hiệu suất thuật toán (O(1), O(n), O(log n)...), hữu ích cho việc chuẩn bị coding interview. Kết thèm video và câu hỏi Reddit hỗ trợ tự học. #BigONotation #CodingInterview #TimeComplexity #ComputerScienceTutorial #VietnameseTechCommunity

https://www.reddit.com/r/programming/comments/1puq6nk/bigo_notation_everything_you_need_for_coding/

Time Complexity (Big O) simplified:

- When your calculation is not dependent on the input size, it is a constant time complexity (O(1)).
- When the input size is reduced by half, maybe when iterating, handling recursion, or whatsoever, it is a logarithmic time complexity (O(log n)).
- When you have a single loop within your algorithm, it is linear time complexity (O(n)).
- When you have nested loops within your algorithm, meaning a loop in a loop, it is quadratic time complexity (O(n^2)).
- When the growth rate doubles with each addition to the input, it is exponential time complexity (O2^n).

#timecomplexity #BigO #programming #code #complexity

This is not the best sort, to say the least. But I do appreciate in this video how it demonstrates O(n^2) time complexity with just a single loop. Just because it's only one loop doesn't mean you're getting away with O(n)!

https://www.youtube.com/watch?v=9cIjvXEeOhQ

#programming #gnomesort #sorting #timecomplexity #bigo

Gnome sort, child of insertion and bubble sort in 3 minutes!

YouTube