DATA STRUC MIDTERM

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

1/115

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:46 PM on 10/5/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

116 Terms

1
New cards
Linear Data Structure
A data structure where elements are organized sequentially in a linear order.
2
New cards
Array
A fixed
3
New cards
Array Index
A number used to identify the position of an element in an array.
4
New cards
One
Dimensional Array
5
New cards
Two
Dimensional Array
6
New cards
Array Declaration
The process of defining an array variable using a data type and array name.
7
New cards
Array Declaration Syntax
type[] arrayName;
8
New cards
Array Creation
Creating an array using the new keyword and specifying its size.
9
New cards
Array Element
A single value stored at a specific index of an array.
10
New cards
Array Access
Retrieving an array element using its index.
11
New cards
Array Element Modification
Changing an array element by assigning a new value to its index.
12
New cards
Array Length
The number of elements an array can contain, accessed using the .length property.
13
New cards
Static Array
An array with a fixed size that cannot be changed after creation.
14
New cards
Static Array Size
The size of a static array is determined when the array is created.
15
New cards
Static Array Access
Static array elements can be accessed in constant time.
16
New cards
Static Array Usage
Useful when the number of elements is known beforehand.
17
New cards
Dynamic Array
An array that can grow or shrink during runtime.
18
New cards
Dynamic Array in Java
ArrayList is used to create resizable arrays in Java.
19
New cards
ArrayList
A Java collection that can dynamically grow and shrink.
20
New cards
ArrayList Add
The add() method inserts an element into an ArrayList.
21
New cards
Static Array Example
int[] numbers = new int[6];
22
New cards
Dynamic Array Example
ArrayList<Integer> numbers = new ArrayList<>();
23
New cards
Linked List
A chain of nodes where each node contains data and a reference to another node.
24
New cards
Node
An element of a linked list that contains data and one or more references.
25
New cards
Singly Linked List
A linked list where each node contains data and a reference to the next node.
26
New cards
Singly Linked List Node
A node containing data and a next reference.
27
New cards
Next Pointer
A reference that points to the next node in a linked list.
28
New cards
Null in Singly Linked List
The next reference of the last node is null.
29
New cards
Doubly Linked List
A linked list where each node has references to both previous and next nodes.
30
New cards
Previous Pointer
A reference that points to the previous node in a doubly linked list.
31
New cards
Doubly Linked List Node
A node containing data, a previous reference, and a next reference.
32
New cards
Head
A reference to the first node of a linked list.
33
New cards
Tail
A reference to the last node of a linked list.
34
New cards
Forward Traversal
Traversing a doubly linked list from head to tail using next.
35
New cards
Backward Traversal
Traversing a doubly linked list from tail to head using prev.
36
New cards
Linked List Traversal
Visiting each node one by one to read, display, or process its data.
37
New cards
Linked List Insertion
Adding a new node to a linked list.
38
New cards
Linked List Deletion
Removing an existing node from a linked list.
39
New cards
Linked List Search
Finding a node containing a specific value.
40
New cards
Linked List Sort
Arranging linked list values in ascending or descending order.
41
New cards
Search Process
Start at head, compare the value, move to next, and repeat until found or null.
42
New cards
Linked List Random Access
Linked lists do not support random access like arrays.
43
New cards
Collections.sort()
A Java method used to sort the values of a built
44
New cards
Tree
A hierarchical data structure used to represent relationships between elements.
45
New cards
Binary Tree
A tree where each parent node can have at most two children.
46
New cards
Root
The topmost node of a tree.
47
New cards
Parent Node
A node that has one or more child nodes.
48
New cards
Child Node
A node connected below another node in a tree.
49
New cards
Left Child
The child node located on the left side of a binary tree node.
50
New cards
Right Child
The child node located on the right side of a binary tree node.
51
New cards
Leaf Node
A node that has no children.
52
New cards
Binary Tree Node Fields
Data, pointer to the left child, and pointer to the right child.
53
New cards
Tree Traversal
The process of visiting every node in a tree exactly once in a specific order.
54
New cards
Breadth
First Traversal
55
New cards
Level Order Traversal
Another name for Breadth
56
New cards
Queue in Tree Traversal
A queue is used to implement Breadth
57
New cards
Depth
First Traversal
58
New cards
Inorder Traversal
Visits Left subtree, Root, then Right subtree.
59
New cards
Preorder Traversal
Visits Root, Left subtree, then Right subtree.
60
New cards
Postorder Traversal
Visits Left subtree, Right subtree, then Root.
61
New cards
Inorder BST Result
Inorder traversal of a BST retrieves values in sorted order.
62
New cards
Preorder Use
Commonly used for duplicating trees or evaluating prefix expressions.
63
New cards
Postorder Use
Useful for deleting trees or evaluating postfix expressions.
64
New cards
Level Order Example
For the sample tree, the order is 10, 5, 15, 2, 7, 12.
65
New cards
Binary Search Tree
An ordered binary tree used for retrieving, sorting, and searching data.
66
New cards
BST Left Rule
All nodes in the left subtree contain keys less than the node's key.
67
New cards
BST Right Rule
All nodes in the right subtree contain keys greater than the node's key.
68
New cards
BST Subtree Rule
Both the left and right subtrees must also be valid BSTs.
69
New cards
BST Duplicate Rule
The handout specifies that BSTs do not allow duplicate nodes.
70
New cards
BST Unique Key
Every node in the BST has a unique key.
71
New cards
BST Ordering Rule
Left subtree < Node < Right subtree.
72
New cards
BST Search Direction
Smaller values go left and greater values go right.
73
New cards
Binary Tree vs BST
A binary tree has no required ordering rule, while a BST follows strict ordering.
74
New cards
AVL Tree
A self
75
New cards
AVL Balance Factor
The difference between the height of the left subtree and right subtree.
76
New cards
Balance Factor Formula
Balance Factor = Height of Left Subtree
77
New cards
AVL Balance Factor +1
The left subtree is taller by one.
78
New cards
AVL Balance Factor 0
The left and right subtrees have equal height.
79
New cards
AVL Balance Factor
1
80
New cards
AVL Unbalanced Factor
A balance factor beyond
81
New cards
AVL Rotation
A tree restructuring operation used to restore AVL balance.
82
New cards
LL Rotation
Left
83
New cards
RR Rotation
Right
84
New cards
LR Rotation
Left
85
New cards
RL Rotation
Right
86
New cards
LL Pattern
Insertion occurs in the left subtree of the left child.
87
New cards
RR Pattern
Insertion occurs in the right subtree of the right child.
88
New cards
LR Pattern
Insertion occurs in the right subtree of the left child.
89
New cards
RL Pattern
Insertion occurs in the left subtree of the right child.
90
New cards
LL Memory Trick
LL means Right Rotation.
91
New cards
RR Memory Trick
RR means Left Rotation.
92
New cards
LR Memory Trick
LR means Left then Right.
93
New cards
RL Memory Trick
RL means Right then Left.
94
New cards
Hierarchical Data
Data organized according to relationships between levels or entities.
95
New cards
File System Trees
Trees represent directories, subdirectories, and files.
96
New cards
Organizational Chart
A hierarchical structure commonly represented using trees.
97
New cards
DOM Tree
The tree structure used to represent nested HTML or XML elements.
98
New cards
BST Applications
Searching, sorting, insertion, and deletion of data.
99
New cards
AVL Applications
Maintaining balanced height for consistent efficient operations.
100
New cards
Red
Black Tree