100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CMPT225 Final Review 2. Simon Fraser University CMPT 225 $10.49   Add to cart

Exam (elaborations)

CMPT225 Final Review 2. Simon Fraser University CMPT 225

 5 views  0 purchase
  • Course
  • Institution

CMPT225 Final Review - MT 后 ppt22 Binary Heap ADT class ppt23 Priority Queue ADT class ppt26 Binary heap sort (见 MT 前 Sorting) ppt27-31 Hashing ADT class, Collision resolution strategies ppt32 Dictionary ADT class ppt33-34 Disk-bound data ppt34-36 Merge sort (见 MT 前 Sorting), B-tre...

[Show more]

Preview 3 out of 18  pages

  • April 9, 2023
  • 18
  • 2022/2023
  • Exam (elaborations)
  • Questions & answers
avatar-seller
CMPT225 Final Review - MT 后

ppt22 Binary Heap ADT class
ppt23 Priority Queue ADT class
ppt26 Binary heap sort (见 MT 前 Sorting)
ppt27-31 Hashing ADT class, Collision resolution strategies
ppt32 Dictionary ADT class
ppt33-34 Disk-bound data
ppt34-36 Merge sort (见 MT 前 Sorting), B-tree external ADT class




ADT Binary Heap Priority Queue Hashing Dictionary
Array: unsorted/ sorted
Array: unsorted/ sorted
LL: unsorted/ sorted
LL: unsorted/ sorted Array,
CDT Array BST ADT class
BST ADT class Array+LL
AVL ADT class
Binary Heap ADT class: max/ min
Hashing ADT class

,ppt22
1. Binary Heap ADT class:
(1) 定义:
 是 complete binary tree (除最下层的结点可以不连满, 其它层的结点都连满),
且 resulting array 无 gap
 在 complete binary tree 中给结点的计数方式: 逐层数, 从左向右数
 设某结点的 index 为 i:
则其左孩子的 index 为 2*i+1
则其右孩子的 index 为 2*i+2
则其 parent 的 index 为 (i-1)/2 向下取整
所有 index < array capacity
 适用于查找获取最大最小值
 not for general purpose


(2) Max/ Min binary heap:
 Max binary heap: complete binary tree, root 值最大, 左右子树大小无所谓
 Min binary heap: complete binary tree, root 值最小, 左右子树大小无所谓


(3) Operation:
 insert: 加到 index 的下一位, 换位
 remove: 删 root, 最后一位补位, 换位
 retrieve: retrieve root

, Max/ Min binary heap insertion: 加到 index 下一位, 换位

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller beckyfawcet. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $10.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

81113 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling

Recently viewed by you


$10.49
  • (0)
  Add to cart