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

DSA exam 2023 with complete solution questions and answers

Rating
-
Sold
-
Pages
4
Grade
A+
Uploaded on
26-02-2023
Written in
2022/2023

pointer allocation type dynamic - must clean up afterwards arrow operator - - access members of object points to - same as dereferencing an object then using . operator array - contiguous memory - homogenous (one type) - static memory allocation stack - LIFO (undo mechanism) - push to top - pop from top - peek - if it does not contain enough space to add a new item, it overflows linked list - collection of nodes - linear ordering - contains pointer to next node - dynamic allocation double linked list - linked list - contains a pointer to next node and previous node queue - FIFO - enqueue on back - dequeue from front - peek circular queue 3 pointers: 1. to memory buffer 2. start of valid memory 3. end of valid memory bubble sort - bubbles largest to top - compares adjacent values, swaps - easy to implement, slower - good for small sets - uses a nested loops - looks at one less element each time insertion sort - leaves a sorted list as it passes - compares value with all previous values - inserts it into correct spot (rest slide down one) - only sorts if NECESSARY selection sort - finds min element - places it in right spot by SWAPPING - does not look at that element again merge sort - divide: into 2 parts until it cannot - recur: solve each subset by dividing it - conquer: merge them back together in order, 1 layer at a time quick sort - choose pivot - divide: into L, E, G than pivot - recur: keep dividing L and G - conquer: put back by inserting L, E, then G division hash number % size of set boundary folding hash - key is divided into several parts - key is folded on borders of a paper - every other part is put into reverse order = 123 + 456 + 789 sum = key shift folding hash - key is divided into several parts - put underneath one another 0= 123 + 654 + 789 sum = key mid-square hash squares the key, the middle portion is the key extraction hash part of key is used as key ex. first and last 2 nums radix hash - key is transformed into another base number - need additional computation map - key value pairs - key must be unique - elements can be located quickly dictonary - key value pairs (entries) - keys don't need to be unique (multiple definitions for one word) set - collection of distinct objects - all unique objects - automatically sorted in insertion multi-set set that can have duplicate elements length number of edges in a path level length of path + 1 height max level of a node in the tree - empty tree = 0 - single node = 1 AVL tree - height balanced binary tree - difference in height of left and right subtree must be = 1 for all nodes (same height or +1 difference) red-black tree - self-balanced binary tree - red = both children are black - black = leaves N-ary tree - each node cannot have more than N children in-order traversal left, root, right post-order traversal left, right, root pre-order traversal root, left, right graph way of representing relationships that exist between pairs of objects - set of nodes and a collection of pairs of vertices (edges) Verticies in graphs represent objects or states, positions, or are placeholders edge in a graph - pairs of vertices directed vs undirected graph undirected: { u, v } - pair is unorders - can go both ways directed: ( u, v ) - pair is ordered - goes -- direction - each node has a unique path from root with: - initial node: path indicates - terminal node: path terminates traversing a graph - cannot use tree traversal (would result in infinite loops) - each node is marked as visited to avoid revisiting - graphs can have isolated nodes depth first traversal - goes to deepest point (end of path) from root - then visits parent's other child - if no adjacent nodes or all have been visited, it backtracks to parent - finishes when backtracking leads to root - edges are pushed to STACK - pop vertex, visit it breadth-first traversal - level by level - goes to next level once all are visited - uses a QUEUE

Show more Read less
Institution
DSA
Course
DSA








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

Written for

Institution
DSA
Course
DSA

Document information

Uploaded on
February 26, 2023
Number of pages
4
Written in
2022/2023
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.
Arthurmark Chamberlain College Of Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
45
Member since
3 year
Number of followers
39
Documents
1422
Last sold
4 months ago

3.7

9 reviews

5
5
4
0
3
2
2
0
1
2

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 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