Week 7: Linked Lists

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

1/13

flashcard set

Earn XP

Description and Tags

flashcards made from Week 7: Linked Lists slides

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

14 Terms

1
New cards

Structures

Structures help organize heterogeneous data.

A structure is a collection of variables of possibly different types. The variables are called structure members.

A structure has a single type-name, called the structure tag

2
New cards
<p>Defining a struct and Accessing the struct members</p>

Defining a struct and Accessing the struct members

knowt flashcard image
3
New cards

Global operations

knowt flashcard image
4
New cards
<p>Illegal operations and Why not?</p>

Illegal operations and Why not?

knowt flashcard image
5
New cards
<p>Example (1) and (2)</p>

Example (1) and (2)

knowt flashcard image
6
New cards

Size of a struct

knowt flashcard image
7
New cards
<p>Linked lists of structures and Implementation</p>

Linked lists of structures and Implementation

knowt flashcard image
8
New cards

Dynamical lists

Linked lists are useful if you do not know the number of nodes in advance.

The idea is to create new nodes when new data points arrive.

Creating a new node requires allocating a new memory slot of size sizeof(struct node).

The total amount of memory needed is unknown at compile time, i.e. you need to allocate nodes dynamically (using malloc).

9
New cards
<p>The first node and The head</p>

The first node and The head

knowt flashcard image
10
New cards
<p>New nodes and Creating the list</p>

New nodes and Creating the list

knowt flashcard image
11
New cards

Iterations

knowt flashcard image
12
New cards
<p>Printing the list and Freeing the list</p>

Printing the list and Freeing the list

<p></p>
13
New cards

Other linked lists

knowt flashcard image
14
New cards

References

knowt flashcard image