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

Exam (elaborations)

CMPT225 Final Review 1 Simon Fraser University CMPT 225

 9 views  0 purchase
  • Course
  • Institution

CMPT225 Final Review - MT 前 ppt2 ADT ppt3-7 List ADT class, Stack vs Heap memory allocation ppt9 Stack ADT class ppt10 Queue ADT class ppt11-12, 21, 26, 34 Searching, Sorting ppt14-18 BST ADT class ppt19-20 AVL ADT class ppt21 Tree sort (见 Sorting) ADT List Stack/ Queue BST CDT Array,...

[Show more]

Preview 3 out of 22  pages

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

ppt2 ADT
ppt3-7 List ADT class, Stack vs Heap memory allocation
ppt9 Stack ADT class
ppt10 Queue ADT class
ppt11-12, 21, 26, 34 Searching, Sorting
ppt14-18 BST ADT class
ppt19-20 AVL ADT class
ppt21 Tree sort (见 Sorting)



ADT List Stack/ Queue BST

CDT Array, LL Array LL, List ADT class Array, LL

,ppt2
1. ADT
(1) 定义:
 Abstract Data Type/ data collection
 墙前能看: class interface in .h file - public
墙后不能看: data members in .h file - private 和 implementation of methods in .cpp file
 Linux 指令/ .h 和.cpp 文件格式/ Test driver
o description: single responsibility
o precondition: what is true before method is called
o postcondition: what is true after method is called -- ppt4
o exception:




(2) 优缺点:
优:
1. Preserve/control the integrity of a class’ data
2. Ease s/w development team work
3. Ease modification
4. Reduce complexity (from a client code’s perspective)
5. Ease reusability

缺:
1. More code to write: must have getters/setters methods
2. Limited access: user of the class (as writer of client code that makes use of the class),
may feel limited by the class’ public methods


(3) Class invariant:
 是描述 class 特征的 statement
 对于该 class 所有实例化的 objects, 这些特征不变 (True)

, ppt3-7
1. ADT vs CDT:
 ADT: data collection eg: List
 CDT: data structure eg: Array, LL


2. Data organization 分类:
 Linear: 一个 predecessor 一个 successor
 Non-linear: 没有 predecessor 和 successor
 Hierarchical: 一个 predecessor 很多 successor
 Graph: 很多 predecessor 很多 successor


3. List ADT class:
(1) List 分类:
 position-oriented: operations based on position of data
 value-oriented: operations based on value of data


(2) Operation:
1. Position-oriented:
o insert(elemt, position)
o remove(position)
o removeAll()
o elemt get(position)
o int getElemtCount
o append(elemt) 尾加
o swap(position1, position2)

2. Value-oriented:
o insert(elemt)
o remove(elemt)
o removeAll()
o elemt get(elemt)
o int getElemtCount

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.99. 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
$10.99
  • (0)
  Add to cart