Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

CMPT225 Final Review 1 Simon Fraser University CMPT 225

Rating
-
Sold
-
Pages
22
Grade
A+
Uploaded on
09-04-2023
Written in
2022/2023

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

Show more Read less
Institution
Course

Content preview

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

Written for

Course

Document information

Uploaded on
April 9, 2023
Number of pages
22
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$11.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
beckyfawcet Rasmussen College
Follow You need to be logged in order to follow users or courses
Sold
120
Member since
4 year
Number of followers
19
Documents
599
Last sold
3 days ago
GradesBooster

Verified eBooks available for a Quick and Easy Download at Affordable rates I OFFER: -Study Guides -eBooks -ATI Test Prep, Assignments -WGU Papers, \"Task\" Assignments (Complete RN BSN Curriculum), Rubric & Task Info for Each Course -HCI College Nursing Associates Program -NCLEX Prep *ALL WORK HAS PASSED WITHOUT NEEDING REVISIONS AND BY THE RUBRIC.

4.2

27 reviews

5
18
4
3
3
2
2
1
1
3

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions