100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

CPSC 350 Final Exam Graded A+

Rating
-
Sold
-
Pages
9
Grade
A+
Uploaded on
06-03-2025
Written in
2024/2025

CPSC 350 Final Exam Graded A+

Institution
CPSC
Course
CPSC

Content preview

CPSC 350 Final Exam Graded A+
Array benefits - ANSWER-It is better and convenient way of storing the data of same
datatype with same size. It allows us to store known number of elements in it.

Array Big-O runtimes (access, insert, search, delete) - ANSWER-access = O(1)
insert = O(n)
search = O(n)
delete = o(n)

Array disadvantages - ANSWER-- is a static Data structure
-We must know in advance that how many elements are to be stored in array. Only
elements of same data types can be stored in an array. We cannot store elements of
multiple data types in a single array.

Arrays - ANSWER-a collection of items stored in a contiguous memory location and
addressed using one or more indices

AVL trees - ANSWER-- Adelson-Velskii & Landis: Any pair of sibling nodes have a
height difference of at most
- not commonly used in industry

Balanced/Unbalanced BST's - ANSWER-- We will say that a tree is height-balanced if
the heights of the left and right subtrees of each node are within 1
- A tree is perfectly height-balanced if the left and right subtrees of any node are the
same height

Big-O for Linked List (access, insert, search, delete) - ANSWER-access = O(n)
insert = O(1)
search = O(n)
delete = o(1)

Binary Search Tree BST - ANSWER-- Each internal node has at most two children
- Values smaller than the root, left subtree
- Values greater than the root, right subtree
- Each node (vertex) must have exactly one path (edge) to another node
If not, then it's a graph
- The number of children of a given node is called a degree
- Is allows for efficient sorting and searching of data.
- log(N)

Breadth-first search - ANSWER-- We examine all nodes at the same level of the tree
before moving on to the next level
- Finding shortest paths

, - Used for disconverting spanning trees
- Requires more memory than DFS
- uses a Queue
- divides graph into levels
- better for broader graphs

BST advantages - ANSWER-- BST has fast insertion and deletion when balanced
- very efficient

BST disadvantages - ANSWER-- shape of tree determines on insertion and can be
degenerated
- search takes a long time

BubbleSort - ANSWER-- compares 2 numbers
- if the one on the left is bigger, swap
- performance, pretty lousy O(N^2)
- best O(n)
- use when you don't have access to internet and not a large data set

circular Queues - ANSWER-The used memory locations, when free are reused so no
memory is leaked

ex: round Robin schedulers

Depth-first search - ANSWER-- useful for finding whether there is a path from one
vertex to another and whether or not the graph is connected
- in terms of running time, DFS is an efficient method for transversing a graph
- use stack
- checks graph for cycles
- traverses deep into graph by visiting children nodes before sibling/neighbor nodes
- requires less memory

difference between Graphs and trees - ANSWER-- trees are a type of graph
- no loops in trees
- numerous rules in spelling out connections in trees, graph has not rules dictating
connections among nodes

Dijkstra's algorithm - ANSWER-- finds the optimal path from a source vertex to and
endpoint,
Single source
- graph can be a directed or undirected weight graph
- graph needs to have a nonnegative weight on every edge
- used in Google Maps

Dijkstra's algorithm disadvantages - ANSWER-- It do blind search so wastes lot of time
while processing.

Written for

Institution
CPSC
Course
CPSC

Document information

Uploaded on
March 6, 2025
Number of pages
9
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

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.
CLOUND Exam
View profile
Follow You need to be logged in order to follow users or courses
Sold
620
Member since
2 year
Number of followers
389
Documents
11482
Last sold
11 hours ago
PROF MM

HELLO WELCOME TO THIS PAGE WHERE YOU WILL FIND ALL EXAMS ,STUDY GUIDE ,CASE, TESTBANKS AND ANY OTHER STUDY MATERIALS,

4.0

122 reviews

5
64
4
16
3
29
2
3
1
10

Trending documents

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

Frequently asked questions