Đang mở hậu trường...
3 câu hỏi kỹ thuật chủ đề Thuật toán & CTDL, song ngữ Anh-Việt, có đáp án và giải thích.
You are implementing a task scheduler that stores 1,000,000 task priorities in a binary min-heap backed by an array. The team now asks you to also report the task with the HIGHEST priority value (the maximum element), without changing the data structure. Assuming no extra bookkeeping is added, what is the worst-case time complexity of finding that maximum element?
You are designing a leaderboard feature that processes a continuous stream of millions of player scores in real time. The system only needs to display the top 100 highest scores at any given moment and must operate with strictly minimal memory usage ($O(k)$ auxiliary space where $k = 100$). Which data structure and strategy best satisfies these constraints?
A company must provide an exact global top-K dashboard over events distributed across S disjoint shards, with a strict two-second latency target. Scores have a deterministic total ordering, while network bandwidth and coordinator memory are the main constraints; which architecture should the lead engineer select?