1The height of a binary heap with n elements is:A⌊log₂ n⌋Bn/2CnD√nView AnswerDiscussWorkspaceReportSaveEasy
2What is the output of the following code?import heapq print(heapq.nlargest(2, [4, 9, 1, 7]))A[9, 7]B[1, 4]C[7, 9]D[9, 4]View AnswerDiscussWorkspaceReportSaveEasy
3To find the k largest elements of a large stream efficiently, use:AA max-heap of all elementsBA min-heap of size kCA stackDSorting every timeView AnswerDiscussWorkspaceReportSaveEasy
4In a max-heap, every parent is:ALarger than all leaves onlyBGreater than or equal to its childrenCSmaller than its childrenDEqual to its childrenView AnswerDiscussWorkspaceReportSaveEasy
5Building a heap from an unsorted array with bottom-up heapify takes:AO(log n)BO(n)CO(n log n)DO(n²)View AnswerDiscussWorkspaceReportSaveEasy