Lesson 2 - Arrays and Linked List

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/39

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 1:41 AM on 10/2/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

40 Terms

1
New cards

Array

is a collection of elements, each identified by an index or a key, stored in contiguous (adjacent) memory locations. All elements in an array must be of the same data type.

2
New cards

Array Index

Elements are accessed by their indexes.

3
New cards

Array Element

Items stored in an array.

4
New cards

Fixed size (for static arrays)

the size is declared at creation and generally

cannot be changed.

5
New cards

Homogeneous

all elements share the same data type.

6
New cards

Indexed access

each element has a unique index, typically starting at 0 (zero- based indexing).

7
New cards

Contiguous memory allocation

enables fast, direct (random) access to elements.

8
New cards

Fixed size, Homogeneous, Indexed access, Contiguous memory allocation

Key Characteristics of an Array

9
New cards

Constant Time Access

Direct access to any element using its index.

10
New cards

Easy Traversal

Simple to loop through all elements using a for loop.

11
New cards

Effective Data Storage

Useful for storing multiple values of the same type.

12
New cards

Constant Time Access,Easy Traversal,Effective Data Storage

Properties of Arrays

13
New cards

One dimensional array, two dimensional array, multi-dimensional array, static array, and dynamic array

Enumerate the types of array

14
New cards

One dimensional array

is a linear data structure that stores a collection of elements of the same data type in a single, contiguous block of memory. Each element is accessed using an index representing its position.

15
New cards

Two dimensional array

array is a collection of elements arranged in rows and columns, forming a matrix- like structure.

16
New cards

multi-dimensional array

Array with more than two-dimensions.

17
New cards

Static array

Fixed size determined at compile time.

18
New cards

Dynamic array

size can grow or shrink at runtime

19
New cards

traversal, insertion, searching, deletion, updating

Enumerate the types of array operations

20
New cards

Traversal

in an array refers to the process of accessing each element in the array sequentially, typically to perform a specific operation, such as searching, sorting, or modifying the elements.

21
New cards

Insertion

involves adding a new element to a specific position within an array.

22
New cards

Linked List

A linear data structure, in which elements are not stored at a contiguous location, rather they are linked using pointers.

23
New cards

Node Structure

A node in a linked list typically consists of two components:

Data and Next pointer

24
New cards

Data

It holds the actual value associated with the node.

25
New cards

Next Pointer

It stores the memory address (reference) of the next node in the sequence.

26
New cards

Head and Tail

The linked list is accessed through the __ node, which points to the first node in the list. The last node in the list points to NULL or null pointer, indicating the end of the list. This node is known as the _ node.

27
New cards

Singly linked list, doubly linked list, circular linked list

Enumerate the types of linked list

28
New cards

Singly linked list

Each node contains a reference to the next node in the sequence. Traversing this linked list is done in a forward direction.

29
New cards

Doubly linked list

Each node contains references to both the next and previous nodes. This allows for traversal in both forward and backward directions, but it requires additional memory for the backward reference.

30
New cards

Circular linked list

The last node points back to the head node. It can be either singly or doubly linked.

31
New cards

insertion, deletion, searching and traversing

Enumerate the types of linked list operations

32
New cards

Dynamic size

Linked lists do not have a fixed size, so you can add or remove elements as needed, without having to worry about the size of the list. This makes linked lists a great choice when you need to work with a collection of items whose size can change dynamically.

33
New cards

Efficient Insertion and Deletion

Inserting or deleting elements in a linked list is fast and efficient, as you only need to modify the reference of the next node.

34
New cards

Easy to navigate

Linked lists can be easily traversed, making it easier to find specific elements or perform operations on the list.

35
New cards

Slow access time

Accessing elements in a linked list can be slow, as you need to traverse the linked list to find the element you are looking for.

36
New cards

Pointers

Linked lists are more complex to understand and use compared to arrays. This complexity can make linked lists more difficult to debug and maintain.

37
New cards

Higher overhead

Linked list requires extra memory to store the reference to the next node.

38
New cards

Cache inefficiency

In linked lists the memory is not contiguous. This means that when you traverse a linked list, you are not likely to get the data you need in the cache, leading to cache misses and slow performance.

39
New cards

Extra memory required

Linked lists require an extra pointer for each node, which takes up extra memory.

40
New cards

Static array

An array of fixed size.