Binary Heaps Lecture, May 6, 2022

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ก.ย. 2024
  • This video introduces the binary heap data structure. A binary heap is a completely filled tree-like data structure which can be implemented efficiently with an array. The tree maintains the "heap property, " meaning that for any node, all of that node's children are of lesser or equal "priority." Because of this property, accessing the highest priority element is a constant-time O(1) operation. Heaps have three primary functions: peek(), which returns the element with the highest priority but does not modify the heap; enqueue(x), which enqueues the element x into the heap and preserves the heap property for all nodes; and dequeue(), which removes (and returns) the element with the highest priority, also preserving the heap property for all nodes. Both enqueue(x) and dequeue() run in O(log N) time, making the binary heap an efficient and useful data structure, principally for the "priority queue" abstract data type.

ความคิดเห็น • 4

  • @timo7964
    @timo7964 2 ปีที่แล้ว

    Thanks for uploading!

  • @薛浩-t6q
    @薛浩-t6q 2 ปีที่แล้ว +1

    great, stanford yyds

  • @AshutoshKumar-of7ne
    @AshutoshKumar-of7ne 2 ปีที่แล้ว

    Plz upload further videos as well.

  • @JorgeCrespoyMuchomas
    @JorgeCrespoyMuchomas 2 ปีที่แล้ว

    Puede hacer un vídeo sobre sistema numérico trinario balanciado osea -1 0 1