CS 3354 data structures sheet

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/25

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

26 Terms

1
New cards

Insert in unordered array with lazy deletion?

Amortized O(1) — occasional resizing; average O(1).

2
New cards

Find in unordered array?

O(N) — linear scan required.

3
New cards

Update in unordered array?

O(N) — must locate element first.

4
New cards

Delete in unordered array with lazy deletion?

O(N) — find (O(N)) + mark deleted (O(1)).

5
New cards

Delete in unordered array with shift?

O(N) — find (O(N)) + shift elements (O(N)).

6
New cards

Insert at head in unordered singly linked list?

O(1) — change head pointer.

7
New cards

Insert at tail in unordered SLL with tail pointer?

O(1) — tail pointer allows direct insertion.

8
New cards

Insert at tail in SLL without tail pointer?

O(N) — must traverse from head.

9
New cards

Find/update/delete in SLL?

O(N) — traversal dominates; pointer changes are O(1).

10
New cards

Insert in ordered array?

O(N) — may need to shift elements to maintain order.

11
New cards

Find/update/delete in ordered array with lazy deletion?

O(log N) — binary search for element; marking deleted O(1).

12
New cards

Delete in ordered array with shift?

O(N) — binary search O(log N) + shift up to N elements.

13
New cards

Insert in ordered SLL/DLL?

O(N) — must traverse to correct position.

14
New cards

Find/update/delete in ordered SLL/DLL?

O(N) — traversal dominates; pointer changes are O(1).

15
New cards

Can you binary search a linked list?

No — nodes aren’t contiguous; only know next/prev pointers.

16
New cards

Push in dynamic array stack?

Amortized O(1) — occasional resize O(N) but average O(1).

17
New cards

Pop or peek in array stack?

O(1) — constant time.

18
New cards

Push/Pop/Peek at head in SLL stack?

O(1) — head insertion/removal.

19
New cards

Push at tail, pop from tail in SLL with tail pointer?

Push O(1), Pop O(N) — must traverse to predecessor of tail.

20
New cards

DLL stack at head/tail?

O(1) for all — prev pointers allow constant-time removal at tail or head.

21
New cards

Enqueue in normal array queue?

Amortized O(1) — insertion at end; may require resize.

22
New cards

Dequeue in array queue?

O(N) — shift all elements left.

23
New cards

Enqueue/dequeue in circular array?

O(1) — no shifting required; wrap-around indexing.

24
New cards

Enqueue at head, dequeue at tail in SLL queue without tail pointer?

Enqueue O(1), Dequeue O(N) — must traverse to remove tail.

25
New cards

Enqueue at tail, dequeue at head in SLL queue with tail pointer?

Both O(1) — standard queue implementation.

26
New cards

DLL queue enqueue/dequeue?

O(1) — head or tail insertion/removal possible.

Explore top flashcards