Data Structures and Algorithms Lecture Flashcards

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/13

flashcard set

Earn XP

Description and Tags

A set of practice flashcards covering core concepts from data structures and algorithms, including sorting complexities, tree properties, and complexity analysis.

Last updated 4:58 AM on 4/29/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

14 Terms

1
New cards

How is the abstract class Stack structure defined in the lecture notes?

abstract class Stack { abstract void push(T item); abstract T pop(); }

2
New cards

According to the transcript, what is the distinction between Generics and an ADT in terms of guarantees?

Generics guarantee each operation runs in O(1)O(1) time, whereas an ADT guarantees only correctness, not speed.

3
New cards

What is the expected running time for Quick Sort on average over random pivot choices, and what is its potential worst-case?

The expected time is O(nextlog(n))O(n ext{ log }(n)), but a specific input may take O(n2)O(n^2).

4
New cards

When is it appropriate to use a sorting strategy for data with many duplicates but an unknown range?

When the data contains many duplicates but the range is unknown.

5
New cards

Why might Radix Sort be implemented as unstable according to the notes?

To avoid the overhead of maintaining insertion order within buckets.

6
New cards

What is one reason provided for why a recurrence might not be solved using the Master Theorem?

The Master Theorem does not apply in certain cases, such as when n/extlog(n)n / ext{ log }(n) is not asymptotic.

7
New cards

What is a mandatory property for NIL leaves in a Red-Black Tree?

Every NIL leaf is black.

8
New cards

What is the result of an in-order traversal of a Binary Search Tree?

It lists all keys in sorted order.

9
New cards

Which specific algorithm is identified for graph operations in the transcript?

Kruskal’s algorithm.

10
New cards

In a tree with nn vertices, how many edges are present?

n1n - 1

11
New cards

What is the stated running time for Fibonacci when memoization is not considered helpful in the given context?

Still extΘ(2n)ext{Θ}(2^n)

12
New cards

If an algorithm is mentioned as having a best-case running time of O(nextlog(n))O(n ext{ log }(n)), what does that imply about the best-case bound?

The best-case running time must also be O(nextlog(n))O(n ext{ log }(n)).

13
New cards

How is the extΘext{Θ} bound determined in a general case?

The average case determines the extΘext{Θ} bound.

14
New cards

What complexity is associated with scanning the adjacency list of each vertex in a graph?

Scanning the adjacency list of each vertex is represented as a fundamental operation, often linked to complexity bounds like extΘ(n)ext{Θ}(n) or O(n2)O(n^2) depending on the graph density.