Linked Lists (Week 3)

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/6

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.

7 Terms

1
New cards

What does a Node contain?

-Data

-Next pointer

-Prev pointer (depends)

2
New cards

Describe “Singly Linked List”

-Null-terminated (at front and tail)

-Head/Tail access

-Only next pointer

3
New cards

Describe “Doubly Linked List”

-Null-terminated (at front and tail)

-Head/Tail access

-Next and Prev pointer

4
New cards

What are Sentinel nodes?

-Dummy nodes that hold no value

-Found at the front and end of list

5
New cards

Advantage of Sentinel nodes?

-Same code for deleting and inserting at beginning and end of list

6
New cards

Difference between Arrays and Linked List?

Arrays have a fixed size and allow random access, while linked lists are dynamic in size and require sequential access.

7
New cards

What is the runtime of Insertion Sort algorithm?

-Average and worst: O(n²)

-Best case (sorted): O(n)