Heaps Basic ldea Heaps:Storage Q 1:Why do we implement a heap with an array? PARENT() 16 1 return [i/2] 10 12345678910 LEFT(i) 1614i0879324] 1 return 2i RIGHT(i) (b) 1 return 2i+1 Easy to index o Save memory o Better cache locality 4口4的,,左+生,2分Q0 MA Jun (Institute of Computer Software) Problem Solving May4,2022 4/30Heaps Basic Idea Heaps: Storage Q 1: Why do we implement a heap with an array? Easy to index Save memory Better cache locality MA Jun (Institute of Computer Software) Problem Solving May 4, 2022 4 / 30