Static and Dynamic Allocation Linked Lists

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

1/22

flashcard set

Earn XP

Description and Tags

Flashcards about Static and Dynamic Allocation of variables, Pointers and Linked Lists

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

23 Terms

1
New cards

Static data types

Allocate a fixed amount of memory at compile time, dictating the maximum number of elements it can hold.

2
New cards

Dynamic Data Structures

A solution to the limitations of static data types, allowing for more flexible memory allocation.

3
New cards

Linked Lists

An example of dynamic data structures

4
New cards

RAM

Random Access Memory, the memory all computers have

5
New cards

Variable

A contiguous area in memory whose size depends on its type.

6
New cards

Pointer

A variable that contains the address of another variable as its value.

7
New cards

Static Allocation

Memory for variables is allocated at compile time and remains fixed throughout the program's execution.

8
New cards

Dynamic Allocation

Memory for variables is allocated at runtime and can be resized or deallocated as needed.

9
New cards

Allocate()

A function used in dynamic memory allocation to obtain a new zone in the heap, returning its address.

10
New cards

Free()

A function used in dynamic memory allocation to return a memory location from the heap, destroying the link to the pointer.

11
New cards

Linked List

A sequence of dynamically allocated elements (nodes) linked together to represent a set of information.

12
New cards

Node

Represent each information and composed of 2 fields, an information field and an address field

13
New cards

Linked List Head

The address of the first element of a linked list.

14
New cards

Linked List Model

A set of operations defined to develop algorithms on linked lists.

15
New cards

Value(p)

Returns the content of the ”info” field of the node pointed to by p

16
New cards

Next(p)

Returns the content of the 'next' field (address) of the node pointed to by p

17
New cards

Ass Val(p, v)

Procedure which assigns the value v to the ”info” field of the node pointed to by ”p”

18
New cards

Ass Addr(p, q)

Procedure which assigns the address q to the ”next” field of the node pointed to by p

19
New cards

Circular Linked List

A list whose last node points to the first node.

20
New cards

Doubly Linked List

A list that can be traversed in either direction, with each node containing the address of the previous node.

21
New cards

Prev(p)

A function which returns the content of the ''prev'' field, it is used to access the left (previous) node.

22
New cards

Ass l addr(p, q)

In the ”prev” field (left address) of the node with address p, we store the address q.

23
New cards

Ass r addr(p, q)

In the ”next” field (right address) of the node with address p, we store the address q.