100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Class notes

CSC 2001F - Data structures Notes

Rating
-
Sold
-
Pages
16
Uploaded on
21-05-2024
Written in
2021/2022

This is a comprehensive and detailed note on data structures for CSC 2001F. Quality stuff!! U'll need it!!











Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
May 21, 2024
Number of pages
16
Written in
2021/2022
Type
Class notes
Professor(s)
Prof. hussein
Contains
All classes

Subjects

Content preview

Modelling  Objects in the real world must be modelled as abstract mathematical
entities and basic data types.

Operations  How one stores, accesses and manipulates these entities and the
formal meaning of these operations.

Representation  How these entities are actually represented in a computer’s memory.

Algorithms  Methods used to perform these operations



 It’s an abstract/mathematical formalisation about:
o How to store a collection of objects in memory
o Operations that are performed on the data
o Algorithms for those operations
o How time and space efficient those algorithms are


 Data storage and operations can be encapsulated by an ADT.
 ADT specifies permitted operations as well as guaranteeing time and space.
 The user is unconcerned with how it’s implemented.
 ADTs are a concept or a convention:
o Not something that directly appears in your code
o Programming language may provide support for ADTs to users
 The Dictionary ADT is the most basic and useful of ADTs


 Dynamic programming is a method for solving a complex problem by breaking it down into a
collection of sub-problems.
 Choice of data structures can make a big difference in speed.
 ADTs encapsulate and hide implementation of a data structure, while presenting a clean interface
to other programmers.
 Using naïve methods, many sub-problems can be solved only once and used many times over.

, Ordering  Put keys into some order so that we know something about how the keys relate to
each other.
Linking  Add pointer to each record to find related records quickly.
 Pointers let us express relationships between pieces of information.
 Pointers of a particular element show the previous and the next element in the list.
 Insertion and deletion is easier.
 Don’t have to know the size of the data at the start.
Partitioning  Divide the records into two or more groups, each group sharing a particular property.
 Partitioning usually combines with linking to point to either of the two halves.
 Examples:
o Binary space partitioning (BST)
o Bounding volume hierarchies
o Quad-trees
o KD-trees
o Bins.  ??
 There are many techniques to ensure balance in some form or another.
 Binary search guarantees balance b always picking the median.
 When using a linked structure, it is not so easy to find the median.

,  The running time of an algorithm varies with the input and typically grow with the input size.
 Average case is difficult to determine so instead we focus on fining the worst case run time.
 How to Measure Running Time?
Method How? Why not?
Experimentally Measure the actual running time of the  Actual running time also depends on a
program that implements the algorithm number of other exterior factors that
cannot be accounted for in the test.
 The test inputs could not entirely test
the algorithm.
Theoretically By inspecting the pseudo-code, we can  Nope. Totes use it actuals.
determine the run time. This uses a high-
level description of the algorithm and
takes in all possible accounts


 Running time of any program on a given computer depends on the number of inputs to process:
o Running Time = 𝑇(𝑛) where 𝑛 is the number of data elements.
Linear 𝑇(𝑛) has dominant term 𝑛
Logarithmic 𝑇(𝑛) has dominant term log 2 𝑛
Quadratic 𝑇(𝑛) has dominant term 𝑛2
Cubic 𝑇(𝑛) has dominant term 𝑛3
 Run times for small inputs are not very useful:
o We want run time indications for large to extremely large 𝑛.
 Algorithmic Analysis must compare functions and emphasise differences for large 𝑛 values.


 We use big-O notation to compare function based on their rate of growth.
 Properties:
o Dominant term determines the growth rate
o Values of constants are irrelevant
o Small values of 𝑛 are irrelevant.
o Example if 𝑓(𝑛) = 𝑛3 + 100𝑛2 then 𝑂(𝑛 3 ) thus the time complexity is of cubic time
 It focuses on the largest term and ignores constants
o The largest term will eventually dominate for large enough 𝑛.
o Constants depend on irrelevant things like clock speed, Operating System, etc.
 Definition:
o 𝑇(𝑛) is 𝑂(𝑓(𝑛)) if:
𝑇(𝑛)
lim =𝑐
𝑛→∞ 𝑓(𝑛)

Where 𝑐 is a constant.

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.
anyiamgeorge19 Arizona State University
View profile
Follow You need to be logged in order to follow users or courses
Sold
60
Member since
2 year
Number of followers
16
Documents
7001
Last sold
1 week ago
Scholarshub

Scholarshub – Smarter Study, Better Grades! Tired of endless searching for quality study materials? ScholarsHub got you covered! We provide top-notch summaries, study guides, class notes, essays, MCQs, case studies, and practice resources designed to help you study smarter, not harder. Whether you’re prepping for an exam, writing a paper, or simply staying ahead, our resources make learning easier and more effective. No stress, just success! A big thank you goes to the many students from institutions and universities across the U.S. who have crafted and contributed these essential study materials. Their hard work makes this store possible. If you have any concerns about how your materials are being used on ScholarsHub, please don’t hesitate to reach out—we’d be glad to discuss and resolve the matter. Enjoyed our materials? Drop a review to let us know how we’re helping you! And don’t forget to spread the word to friends, family, and classmates—because great study resources are meant to be shared. Wishing y'all success in all your academic pursuits! ✌️

Read more Read less
3,4

5 reviews

5
2
4
0
3
2
2
0
1
1

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 exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

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

Student with book image

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

Alisha Student

Frequently asked questions