DSA

0.0(0)
studied byStudied by 0 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/77

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

78 Terms

1
New cards

Data

A collection of facts from which conclusions may be drawn (example: temperature = 35°C → it is hot).

2
New cards

Variable

Placeholder for representing data; in CS, variables hold data in programs.

3
New cards

Data Type

A set of data with predefined values (int, float, char, string, etc.).

4
New cards

System-Defined Data Types

Primitive types built into a language (int, float, char, double, bool).

5
New cards

User-Defined Data Types

Types defined by the user (structures in C/C++, classes in Java).

6
New cards

Data Structure

A particular way of storing and organizing data in a computer for efficient use.

7
New cards

Linear Data Structure

Elements are accessed in sequential order (e.g., arrays, linked lists, stacks, queues).

8
New cards

Non-Linear Data Structure

Elements are accessed in a non-sequential way (e.g., trees, graphs).

9
New cards

Abstract Data Type (ADT)

Combination of data structures with operations (e.g., Stack, Queue, Tree).

10
New cards

Need for Data Structures

Organize data for efficient storage, retrieval, and manipulation.

11
New cards

Characteristics of Data Structures

Correctness, Time Complexity, Space Complexity.

12
New cards
13
New cards

Algorithm

A step-by-step unambiguous procedure to solve a problem.

14
New cards

Good Algorithm Criteria

Correct, finite, terminates, unambiguous, efficient.

15
New cards

Program

An implementation of an algorithm written in a specific programming language.

16
New cards

Algorithm Analysis

Determines which algorithm is most efficient in terms of time/space.

17
New cards

Running Time

Time an algorithm takes, usually dependent on input size n.

18
New cards

Asymptotic Analysis

Describes algorithm performance for large input sizes independent of hardware.

19
New cards
20
New cards

Pseudocode

Plain English representation of an algorithm, less detailed than code.

21
New cards

Control Flow in Pseudocode

if-then-else, while, repeat-until, for-do, indentation.

22
New cards
23
New cards

Asymptotic Notations

Mathematical notations describing running time as input grows.

24
New cards

Big-O Notation

O(n), upper bound; worst-case complexity.

25
New cards

Omega Notation (Ω)

Lower bound; best-case complexity.

26
New cards

Theta Notation (Θ)

Tight bound; average-case complexity.

27
New cards

Rate of Growth

How runtime increases as input size increases.

28
New cards
29
New cards

Common Complexities

Constant O(1), Logarithmic O(log n), Linear O(n), Linearithmic O(n log n), Quadratic O(n^2), Cubic O(n^3), Exponential O(2^n).

30
New cards

Rules of Big-O

Drop constants, drop lower-order terms.

31
New cards
32
New cards

Recursion

A function calling itself to solve a problem.

33
New cards

Base Case

Condition where recursion stops.

34
New cards

Recursive Case

Step where function calls itself on smaller input.

35
New cards

Iteration vs Recursion

Iteration uses loops, recursion uses function calls and base cases.

36
New cards

Backtracking

Algorithmic technique that searches all possibilities, abandoning invalid ones.

37
New cards

Applications of Backtracking

Sudoku, crossword puzzles, mazes, N-Queens problem.

38
New cards
39
New cards

Linked List

Data structure of nodes connected by pointers.

40
New cards

Singly Linked List

Each node points to the next; last node points to NULL.

41
New cards

Doubly Linked List

Each node points to both next and previous.

42
New cards

Circular Linked List

Last node points back to the head, forming a circle.

43
New cards

Linked List Operations

Insert, delete, traverse, count nodes.

44
New cards

Advantages of Linked Lists

Can grow/shrink dynamically, no wasted memory allocation.

45
New cards

Disadvantages of Linked Lists

Slower access O(n), extra memory for pointers.

46
New cards
47
New cards

Stack

Linear data structure; Last In, First Out (LIFO).

48
New cards

Stack Operations

Push (insert), Pop (remove), Peek/Top (view last item).

49
New cards

Stack Exceptions

Underflow (pop from empty), Overflow (push to full).

50
New cards

Applications of Stacks

Expression evaluation, undo in text editors, backtracking, balancing symbols.

51
New cards
52
New cards

Queue

Linear data structure; First In, First Out (FIFO).

53
New cards

Queue Operations

Enqueue (insert at rear), Dequeue (remove from front).

54
New cards

Queue Exceptions

Underflow (remove from empty), Overflow (insert to full).

55
New cards

Applications of Queues

Print queue, call center simulation, async data transfer.

56
New cards

Types of Queues

Simple, Circular, Priority, Deque.

57
New cards
58
New cards

Tree

Non-linear data structure with hierarchical nodes (root, children).

59
New cards

Binary Tree

A tree where each node has at most two children.

60
New cards

Strict Binary Tree

Every node has either 2 children or none.

61
New cards

Full/Perfect Binary Tree

Every node has 2 children, and all leaves are at the same level.

62
New cards

Complete Binary Tree

All levels filled except possibly last, filled from left.

63
New cards

Tree Operations

Insert, delete, search, traverse.

64
New cards

Properties of Binary Trees

Height, number of nodes, leaf count, null links.

65
New cards
66
New cards

Tree Traversal

Visiting all nodes in a tree.

67
New cards

Preorder Traversal (DLR)

Visit root, then left, then right.

68
New cards

Inorder Traversal (LDR)

Visit left, then root, then right.

69
New cards

Postorder Traversal (LRD)

Visit left, then right, then root.

70
New cards

Level Order Traversal

Visit nodes level by level using a queue.

71
New cards
72
New cards

Generic Tree (N-ary)

Tree where each node can have many children.

73
New cards

First Child / Next Sibling Representation

Stores first child and next sibling links; memory efficient.

74
New cards
75
New cards

Threaded Binary Tree

Binary tree using NULL pointers to store predecessor/successor info for traversal.

76
New cards

Types of Threaded Binary Trees

Left-threaded, Right-threaded, Fully-threaded.

77
New cards

Expression Tree

Tree where leaves are operands and internal nodes are operators.

78
New cards