Docsity

Heap Algorithm - Data Structure & Algorithm, Assignments of Data Structures and Algorithms

Partial preview of the text

Download Heap Algorithm - Data Structure & Algorithm and more Assignments Data Structures and Algorithms in PDF only on Docsity!

Group 03 Data Structure and Algorithm

Presentation

Heap

Algorithm

  1. តើតើ Heap Algorithm តើតើតើតើតើតើ?
  2. តើតើតើតើតើតើតើតើ Heap
  3. តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ Heap
  4. តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ Heap - Heap Sort Algorithm
  5. តើតើតើតើតើតើតើ Max Heap
  6. តើតើតើតើតើតើតើតើតើតើតើតើតើ Heap តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ
  7. តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ

Heap Algorithm

02. (^) តើតើតើតើតើតើតើតើ Heap

Heap តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ តើ តើតើតើតើតើតើតើតើតើតើតើតើតើតើ

Max Heap

  • (^) តើតើតើតើតើតើតើតើតើតើ Node តើតើ (Parent) តើតើតើតើតើ តើតើតើតើតើតើតើតើ (Children)
  • (^) Root តើតើតើតើតើតើតើ តើតើតើតើតើតើតើ
  • (^) តើតើតើតើតើតើតើតើតើតើតើតើ

⚬ Heap Sort

⚬ Priority Queue (តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ)

Min Heap

  • (^) តើតើតើតើតើតើតើតើតើតើ Node តើតើ (Parent) តើតើតើតើតើតើ តើតើតើតើតើតើតើតើ (Children)
  • (^) Root តើតើតើតើតើតើតើ តើតើតើតើតើតើតើតើ
  • (^) តើតើតើតើតើតើតើតើតើតើតើតើ

⚬ Priority Queue (តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ)

⚬ Dijkstra Algorithm

Noted: Heap តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ Binary Tree តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ node តើតើតើ 2 childrenតើ

តើតើតើតើ Max តើតើតើ Min Heap តើតើតើ Time Complexityតើ

  • (^) Insert/Delete/Search = O(log n)
  • (^) Build Heap = O(n)

03. (^) តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ Heap

Heap Operations តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ Heap តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ

1. Insertion – តើតើតើតើតើតើ តើតើតើតើតើតើតើតើតើ - (^) តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ - (^) តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ ➡️ តើតើតើតើតើតើតើ: តើតើតើតើតើតើ 15 → តើតើតើតើតើតើតើតើតើតើតើតើតើតើ → តើតើតើតើតើតើតើ 2. Deletion – តើតើតើ Root - (^) តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ (Root) - (^) តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ Root - (^) តើតើតើតើតើតើតើតើ (តើតើតើ តើ តើតើតើ) ➡️ តើតើតើតើតើតើតើ: តើតើតើ 50 តើតើតើ → តើតើតើតើ 10 តើតើតើតើតើ → តើតើតើតើតើតើតើតើ 3. Heapify – តើតើតើតើតើតើតើតើ Heap - (^) តើតើតើតើតើតើ Tree តើតើតើតើតើតើ តើតើតើតើតើតើតើ Heap - (^) តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ ➡️ តើតើតើតើតើតើតើ: តើតើតើ child តើតើតើតើតើ parent → តើតើតើតើតើតើតើតើ 4. Build Heap – តើតើតើតើតើតើ Heap តើតើ Array - (^) តើតើតើតើតើតើតើ array តើតើតើតើតើតើ → តើតើ Heap - (^) តើតើតើតើ Heapify តើតើតើតើតើតើតើតើតើតើតើតើតើតើ ➡️ តើតើតើតើតើតើតើ: [20, 5, 30] → តើតើតើតើតើតើ → Heap

05. (^) តើតើតើតើតើតើតើ Max and Min Heap

Array: [50, 30, 40, 10, 20, 35]

  1. Max Heap តើតើតើតើតើតើតើ
    • (^) Root node តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ
    • (^) តើតើតើតើតើតើតើតើតើតើតើតើ Max Heap
    • (^) តើតើតើតើតើតើតើ 50 តើតើតើតើតើតើតើតើតើតើតើតើតើតើ
    • (^) តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ 50
      1. Min Heap តើតើតើតើតើតើតើ
        • (^) Root node តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ
        • (^) តើតើតើតើតើតើ Min Heap តើតើ Array [10, 20, 35, 30,

40, 50] (តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ)

  • (^) តើតើតើតើតើតើតើ 10 តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ
  • (^) តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ 10

06. (^) តើតើតើតើតើតើតើតើតើតើតើតើតើ Heap

Heap តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ

Scheduling in Operating Systems: តើតើតើតើ Heap តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ (processes) តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ

Priority Queue: Queue តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ តើតើតើតើតើ តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ តើតើតើ តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ Background

Dijkstra Algorithm: តើតើតើតើ Min Heap តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ (Graph)តើ

Resource Allocation: តើតើតើតើតើតើតើតើ (CPU, Memory, etc.) តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ

Huffman Coding (Data Compression) : តើតើតើតើ Min Heap តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ Huffman តើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើតើ

ThankYou