COMP1850 Lecture 9.1 Linked Lists Flashcards

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

1/14

flashcard set

Earn XP

Description and Tags

Flashcards for reviewing linked lists concepts in C and Python.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

15 Terms

1
New cards

Linked List

A data structure made up of Nodes containing data and a link (pointer) to the next Node.

2
New cards

Arrays

Stored in a contiguous block in memory, allows direct access via index, and has a fixed size (or can be reallocated).

3
New cards

Linked Lists

Not contiguous in memory, requires traversal for access, and can grow/shrink dynamically.

4
New cards

When to choose a linked list

When you don't know the number of elements, the number of elements change frequently, you'll be adding/removing elements often and accessing an index isn't required.

5
New cards

Head Pointer

A pointer which indicates where the list begins.

6
New cards

Tail

The node at the end of the linked list, which has a NULL pointer.

7
New cards

Traverse

Visiting each node in the list by following the pointers from the Head to NULL.

8
New cards

Creating a New Node

Allocating memory and assigning initial values to create a new node.

9
New cards

Inserting a Node at the Head

Adjusting links from the head and the new node to include the new node at the beginning of the list.

10
New cards

Inserting a Node

Adjusting links to insert a new node into the list at a specific point.

11
New cards

Deleting a Node

Adjusting links to remove a node from the list and freeing the memory.

12
New cards

Deallocating a Node

Releasing allocated memory for the node's data and the node itself.

13
New cards

Linked-list operations

Insertion, Deletion, InsertAtIndex, and Traversal (e.g., search).

14
New cards

Classes in Python

A combination of data attributes that define the object and methods that define object behaviour.

15
New cards

Structs in C

Data attributes that define the object, with functions defined separately and loosely coupled to the data structure.