Data Structures and Algorithms Complete Lecture Review

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

1/147

flashcard set

Earn XP

Description and Tags

Comprehensive vocabulary flashcards covering fundamentals of data structures, arrays, linked lists, stacks, queues, trees, graphs, sorting, searching, and hashing.

148 Terms

1
New cards

Data

Raw facts and figures, or a value or set of values specifying either a variable or a constant (e.g., marks of students, address of a customer, value of pi).

2
New cards

Information

The processed, structured result of data that provides meaningful context (for example, "Arun is a student, whose age is 12").

3
New cards

Data Structure

A particular way of storing and organizing data in a computer's memory or on disk storage so that it can be used efficiently, expressed as Data Structure=Related Data+Allowed Operations\text{Data Structure} = \text{Related Data} + \text{Allowed Operations}.

4
New cards

Elementary Data Item

A data item that does not have subordinate data items and is treated as a single, indivisible entity (such as a student's roll number).

5
New cards

Group Data Item

A data item composed of one or more subordinate data items (for example, a student's name divided into first name, middle name, and last name).

6
New cards

Record

A collection of related data items grouped together, such as Student_ID, Student_name, City, and Age.

7
New cards

File

A collection of related records, such as the records of all 24 students in a class stored together.

8
New cards

Primary Key

A specific data item whose value uniquely identifies a record within a file (for example, Student_ID).

9
New cards

Primitive Data Structures

The fundamental data types directly supported by a programming language, such as integer, real/float, character, double, and pointer.

10
New cards

Non-Primitive Data Structures

Data structures that are created using primitive data structures, including arrays, linked lists, stacks, queues, trees, and graphs.

11
New cards

Linear Data Structure

A data structure in which elements are stored in a linear or sequential order (such as arrays, stacks, queues, and linked lists).

12
New cards

Non-linear Data Structure

A data structure in which elements are not stored in sequential order, permitting hierarchical or interconnected networks (such as trees and graphs).

13
New cards

Linear Array

A collection of similar data elements stored in consecutive, contiguous memory locations, where each item is referenced by an index or subscript.

14
New cards

Array Address Calculation Formula

The mathematical formula to determine the location of element A[k]A[k]: Address(A[k])=BA(A)+w(k−lower_bound)\text{Address}(A[k]) = \text{BA}(A) + w(k - \text{lower\_bound}), where BA\text{BA} is the base address, ww is element size in bytes, and kk is the index.

15
New cards

Array Length Formula

The formula used to compute the total number of elements in a linear array: Length=upper_bound−lower_bound+1\text{Length} = \text{upper\_bound} - \text{lower\_bound} + 1.

16
New cards

Row Major Order

A 2D array memory storage arrangement where elements are stored row by row, calculated using Address(A[I][J])=Base_Address+w(N(I−1)+(J−1))\text{Address}(A[I][J]) = \text{Base\_Address} + w(N(I - 1) + (J - 1)), where NN is the number of columns.

17
New cards

Column Major Order

A 2D array memory storage arrangement where elements are stored column by column, calculated using Address(A[I][J])=Base_Address+w(M(J−1)+(I−1))\text{Address}(A[I][J]) = \text{Base\_Address} + w(M(J - 1) + (I - 1)), where MM is the number of rows.

18
New cards

Parallel Arrays

Two or more arrays that hold related attributes of a record across identical indices (e.g., separate arrays for Name, Course, and Age of the same students).

19
New cards

Sparse Matrix

A matrix in which the majority of the elements have a value of zero.

20
New cards
<p>Triplet Representation</p>

Triplet Representation

A sparse matrix array representation that stores only non-zero values along with their row and column indices, where row 0 specifies the total rows, total columns, and total non-zero elements.

21
New cards

Linked List

A linear data structure consisting of dynamic elements called nodes, each containing a data field and a pointer (link field) storing the address of the next node.

22
New cards

Singly Linked List

The simplest type of linked list in which each node stores data and a single pointer to the next node of the same type, allowing traversal in only one direction.

23
New cards

Circular Linked List

A linked list whose last node's link field points back to the first node (head) rather than containing a NULL\text{NULL} pointer.

24
New cards

Doubly Linked List

A linked list containing three parts per node: a data field, a NEXT\text{NEXT} pointer pointing to the succeeding node, and a PREV\text{PREV} pointer pointing to the preceding node, enabling bidirectional traversal.

25
New cards

Circular Doubly Linked List

A doubly linked list where the NEXT\text{NEXT} field of the last node stores the address of the head node, and the PREV\text{PREV} field of the first node stores the address of the last node.

26
New cards

Header Linked List

A linked list containing a special header node at the beginning whose data field is kept NULL\text{NULL}, classified as either grounded (last node points to NULL\text{NULL}) or circular (last node points to header).

27
New cards

Overflow

A condition that occurs when attempting to insert new data into a data structure when no free space is available in memory.

28
New cards

Underflow

A condition that occurs when attempting to delete data from a data structure that is already empty.

29
New cards

Stack

A linear data structure following the Last-In, First-Out (LIFO) or First-In, Last-Out (FILO) order, where insertions and deletions occur strictly at one end called the top.

30
New cards

Push

The primitive stack operation of adding an element to the top of the stack after verifying that TOP≠MAX−1\text{TOP} \neq \text{MAX} - 1.

31
New cards

Pop

The primitive stack operation of removing and accessing the topmost element of the stack after verifying that TOP≠NULL\text{TOP} \neq \text{NULL}.

32
New cards

Peek

The stack operation that returns or retrieves the value of the topmost element without removing it from the stack.

33
New cards

Polish Notation

Prefix notation in algebraic expressions where operators precede their operands (e.g., +AB+AB), as opposed to infix (A+BA+B) or reverse Polish / postfix (AB+AB+).

34
New cards

Recursion

A programming technique in which a function calls itself to solve smaller versions of a problem, requiring a base case and a recursive case, and utilizing the system stack.

35
New cards

Queue

A linear data structure following the First-In, First-Out (FIFO) principle, where elements are inserted at the rear end and removed from the front end.

36
New cards
<p>Circular Queue</p>

Circular Queue

A linear FIFO data structure (also called a ring buffer) where the last position connects back to the first position, resolving linear queue space waste when rear=MAX−1\text{rear} = \text{MAX} - 1.

37
New cards

Deque

A double-ended queue where elements can be inserted or deleted from either the front (head) or back/rear (tail) end, bypassing the strict FIFO rule.

38
New cards

Input Restricted Queue

A variant of a double-ended queue (deque) in which insertions are allowed only at one end, but deletions can occur from both ends.

39
New cards

Output Restricted Queue

A variant of a double-ended queue (deque) in which deletions are allowed only from one end, but insertions can occur at both ends.

40
New cards

Tree

A non-linear hierarchical data structure consisting of nodes connected by edges, having exactly one root node and no cycles, where nn nodes have exactly n−1n - 1 edges.

41
New cards

Degree of a Node

The number of child nodes descending from a specific node in a tree.

42
New cards

Height of a Tree

The number of edges on the longest path from the root node to a leaf node.

43
New cards

Depth of a Node

The number of edges on the path from the root node to that specific node.

44
New cards

Binary Tree

A hierarchical tree data structure in which each parent node can have at most two children, referred to as the left child and the right child.

45
New cards

Full Binary Tree

A binary tree in which every node has either 00 or 22 children, meaning every non-leaf node has exactly two children.

46
New cards

Complete Binary Tree

A binary tree in which every level ll except possibly the last is completely filled with 2l2^l nodes, and all nodes at the last level are strictly left-aligned.

47
New cards

Skewed Binary Tree

A binary tree in which every node has only either one child or no child, categorized as left-skewed or right-skewed.

48
New cards

Binary Search Tree

A node-based binary tree in symmetric order where every key in the left subtree is less than the node's key, and every key in the right subtree is greater than the node's key.

49
New cards
<p>Expression Tree</p>

Expression Tree

A binary tree representing an arithmetic expression, wherein each internal node represents an operator and each leaf node represents an operand.

50
New cards

Preorder Traversal

A depth-first binary tree traversal that visits the root node first, traverses the left subtree, and then traverses the right subtree (Root→Left→Right\text{Root} \rightarrow \text{Left} \rightarrow \text{Right}).

51
New cards

Inorder Traversal

A depth-first binary tree traversal that traverses the left subtree, visits the root node, and then traverses the right subtree (Left→Root→Right\text{Left} \rightarrow \text{Root} \rightarrow \text{Right}), yielding elements in ascending order in a BST.

52
New cards

Postorder Traversal

A depth-first binary tree traversal that traverses the left subtree, traverses the right subtree, and finally processes the root node (Left→Right→Root\text{Left} \rightarrow \text{Right} \rightarrow \text{Root}).

53
New cards

Graph

A non-linear data structure formally defined as an ordered set G=(V,E)G = (V, E), where V(G)V(G) is a set of vertices (nodes) and E(G)E(G) is a set of edges connecting pairs of vertices.

54
New cards

Regular Graph

A graph where every vertex has the exact same degree (kk), meaning every node has the identical number of neighbors (kk-regular graph).

55
New cards

Complete Graph

A graph where every pair of vertices is connected by an edge, containing exactly n(n−1)2\frac{n(n-1)}{2} edges for nn vertices.

56
New cards

Clique

A subset of the vertex set C⊆VC \subseteq V in an undirected graph G=(V,E)G = (V, E) such that every two distinct vertices in CC are connected by an edge.

57
New cards

Adjacency Matrix

A sequential representation of a graph using a 2D array of size n×nn \times n, where cell A[i][j]=1A[i][j] = 1 if an edge exists from vertex ii to vertex jj, and 00 otherwise, taking O(V2)O(V^2) memory space.

58
New cards

Adjacency List

A linked representation of a graph where each vertex stores a linked list of all destination vertices to which it has connecting edges, saving space for sparse graphs.

59
New cards

Linear Search

A sequential searching algorithm that checks each element of an unordered list one by one until a match is found, with a time complexity of O(n)O(n).

60
New cards

Binary Search

A divide-and-conquer search algorithm that repeatedly divides a sorted list in half to find a target element, achieving a time complexity of O(log⁡n)O(\log n).

61
New cards

Bubble Sort

An internal, stable sorting algorithm that repeatedly compares consecutive adjacent pairs and swaps them if the lower-index element is greater, running in best-case O(n)O(n) and worst-case O(n2)O(n^2).

62
New cards

Selection Sort

An internal, non-stable sorting algorithm that repeatedly identifies the minimum element in the unsorted subarray and swaps it to the front, taking O(n2)O(n^2) time across all cases.

63
New cards

Insertion Sort

A simple sorting algorithm that splits the array into sorted and unsorted segments, picking values from the unsorted segment and inserting them into their correct position in the sorted segment.

64
New cards

Merge Sort

A stable divide-and-conquer algorithm that recursively splits an array into two halves, sorts each half, and merges them back in order, running in O(nlog⁡n)O(n \log n) time with O(n)O(n) space.

65
New cards

Quick Sort

A non-stable divide-and-conquer sorting algorithm developed by C. A. R. Hoare that partitions an array around a chosen pivot value, running in average time O(nlog⁡n)O(n \log n) and worst-case O(n2)O(n^2).

66
New cards

Hashing

A technique that converts a key into a table index using a mathematical algorithm (hash function) to enable search, insertion, and deletion in average O(1)O(1) time.

67
New cards

Division Method (Hashing)

A hash function technique based on the remainder of division, defined by h(k)=k mod mh(k) = k \bmod m, where mm is the hash table size.

68
New cards

Open Hashing

A collision resolution technique (separate chaining) where each hash table slot points to an external linked list of keys that hash to that same index, meaning the table never fills up.

69
New cards

Closed Hashing

A collision resolution technique (open addressing) where all keys are stored directly within the hash table itself by following a probe sequence to find an empty slot.

70
New cards

Linear Probing

A closed hashing method that searches for the next free table slot sequentially using the probe formula h(k,i)=(h(k)+i) mod mh(k, i) = (h(k) + i) \bmod m, which can cause primary clustering.

71
New cards

Data

Raw, unorganized facts and figures that carry very little meaning until they are processed systematically.

72
New cards

Information

The meaningful, processed, and structured result obtained from data processing.

73
New cards

Data Structure

A particular way of organizing and storing data in computer memory or disk storage so that it can be used efficiently; characterized as related data plus allowed operations.

74
New cards

Data Type

The kind or form of a variable used throughout a program that specifies which values the variable can hold, represented as an abstract language-level implementation.

75
New cards

Elementary Data Item

A data item that does not contain subordinate data items and is treated as a single undivided value (e.g., a student roll number).

76
New cards

Group Data Item

A data item composed of one or more subordinate data items (e.g., a student name divided into first, middle, and last name).

77
New cards

Record

A collection of individual data items grouped together to represent a single entity (e.g., student ID, name, city, and age).

78
New cards

File

A collection of related records stored together (e.g., the records of all 24 students in a class).

79
New cards

Primary Key

A specific data item or field in a record whose value uniquely identifies that record within a file.

80
New cards

Linear Data Structure

A data structure whose elements are stored in a sequential or linear order, such as arrays, stacks, queues, and linked lists.

81
New cards

Non-linear Data Structure

A data structure whose elements are not arranged in a sequential order, such as trees and graphs.

82
New cards

Array

A collection of similar data elements stored in consecutive, contiguous memory locations and referenced by a numeric index or subscript.

83
New cards

Row Major Order

A 2D array memory storage method where elements are stored row by row, such that all elements of the first row occupy contiguous memory locations before those of the second row.

84
New cards

Column Major Order

A 2D array memory storage method where elements are stored column by column, such that all elements of the first column occupy contiguous memory locations before those of the second column.

85
New cards

Parallel Arrays

Two or more arrays of identical capacity that hold related attribute data of an entity at corresponding indices.

86
New cards

Sparse Matrix

A matrix in which the majority of the elements have a value of zero.

87
New cards
<p>Triplet Representation</p>

Triplet Representation

A sparse matrix array representation where the 0th row records the total number of rows, columns, and non-zero values, followed by triplets storing the row index, column index, and value of each non-zero element.

88
New cards

Linked List

A dynamic linear data structure consisting of nodes, where each node contains an element of data and a pointer (link) storing the address of the next node.

89
New cards

Singly Linked List

The simplest form of linked list where every node contains data and a single pointer referencing the next node, permitting traversal in only one forward direction.

90
New cards

Circular Linked List

A linked list variation where the next pointer of the final node points back to the first node instead of storing a NULL pointer.

91
New cards
<p>Doubly Linked List</p>

Doubly Linked List

A two-way linked list whose nodes comprise three distinct parts: a data field, a forward pointer (NEXT), and a backward pointer (PREV) referencing the preceding node.

92
New cards

Header Linked List

A special linked list containing a dedicated header node at the very beginning whose data field is typically NULL and is pointed to by the START pointer.

93
New cards

Grounded Header Linked List

A header linked list variant where the NEXT field of the final data node points to NULL.

94
New cards

Circular Header Linked List

A header linked list variant where the NEXT field of the final node stores the address of the initial header node.

95
New cards

Overflow

A condition that occurs during insertion when an attempt is made to allocate space or add an item to a data structure that has reached maximum capacity.

96
New cards

Underflow

A condition that occurs during deletion when an attempt is made to remove an element from an empty data structure.

97
New cards

Stack

A linear data structure operating under the Last-In, First-Out (LIFO\text{LIFO}) principle, where element insertion (push) and deletion (pop) take place exclusively at a single position called the TOP.

98
New cards

Peek

A stack operation that inspects and retrieves the value of the topmost element without removing it from the stack.

99
New cards

Polish Notation

A prefix algebraic notation where every operator is placed before its respective operands (e.g., +AB+ A B).

100
New cards

Reverse Polish Notation

A postfix algebraic notation where every operator is placed immediately after its respective operands (e.g., AB+A B +).