Heaps Basic Idea Heaps:Storage Q-1:Why do we implement a heap with an array? PARENT(i) 16 I return [i/2] 10 12345678910 LEFT() 1614108793241] 1 return 2i RIGHT(i) (b) 1 return 2i+1 Easy to index ●Save memory o Better cache locality 4口卡40,在是生Q0 MA Jun (Institute of Computer Software) Problem Solving My7.20204/29. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Heaps 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 7, 2020 4 / 29