Untitled Flashcards Set

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

1/52

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.

53 Terms

1
New cards

Algorithm Efficiency

Describes how well an algorithm performs in terms of time and space as the input size grows.

2
New cards

Growth Functions of a Program

Shows how the running time or space of a program increases with input size.

3
New cards

Asymptotic Complexity of an Algorithm

Focuses on how an algorithm behaves as the input size approaches infinity.

4
New cards

Big-O Notation (Upper Bound)

Gives the worst-case upper bound on an algorithm's growth rate.

5
New cards

Big-O / Order Categories

Includes classes of algorithm efficiency based on input growth like O(1), O(n), O(n^2).

6
New cards

Comparing Growth Functions and Orders

Analyzes which growth function increases faster as input size becomes very large.

7
New cards

Analyzing Loop / Nested Loops Execution

Single loops contribute O(n) time, while nested loops multiply complexities.

8
New cards

ADT (Abstract Data Type)

Defines a logical data model and operations, independent of implementation.

9
New cards

Stack

A Last-In-First-Out (LIFO) structure.

10
New cards

Linear and Non-Linear Collections

Linear collections store data in sequence, while non-linear organize data hierarchically.

11
New cards

Stack Operations

Include push(), pop(), peek(), and isEmpty().

12
New cards

Concept of Stack Implementation

Stacks can be implemented using arrays or linked lists.

13
New cards

Operations for Stack (p13 of PPT)

Standard operations: push, pop, peek/top, isEmpty, isFull.

14
New cards

Idea of Applications of Stack

Useful in undo features, parsing expressions, recursion support, and backtracking.

15
New cards

Linked Structures

Store elements as nodes, with references to other nodes.

16
New cards

Linked Lists

A linear data structure with nodes connected via pointers.

17
New cards

What is a Queue? Queue’s Features

A First-In-First-Out (FIFO) structure.

18
New cards

Operations of Queue

Basic operations include enqueue, dequeue, peek, isEmpty, and isFull.

19
New cards

Implementation of Queue

Queues can be implemented using arrays, linked lists, or circular buffers.

20
New cards

What is a List?

An ordered collection of elements where duplicates are allowed.

21
New cards

Three Types of List Collections

Java provides ArrayList, LinkedList, and Vector.

22
New cards

Standard LinkedList in Java

Implements List and Deque interfaces efficiently.

23
New cards

Recursion

When a method calls itself to solve a smaller instance of the same problem.

24
New cards

Recursive Definitions

Specify rules to define an object in terms of itself.

25
New cards

Infinite Recursion

Occurs when a recursive function lacks a base case.

26
New cards

Recursion in Math

Defines functions using previous values.

27
New cards

Recursive Programming

Simplifies problems like tree traversal but needs a base case.

28
New cards

Recursion vs. Iteration

Recursion is elegant but uses more memory; iteration is often more efficient.

29
New cards

Linear Search

Checks each element one by one; time complexity O(n).

30
New cards

Binary Search

Searches a sorted array by repeatedly dividing it in half; time complexity O(log n).

31
New cards

Comparing Search Algorithms

Binary search is faster for sorted data; linear search is better for unsorted data.

32
New cards

Sorting

Arranges elements in a defined order.

33
New cards

Selection Sort

Repeatedly finds the minimum and positions it correctly; O(n^2).

34
New cards

Insertion Sort

Builds a sorted array by inserting elements; O(n^2).

35
New cards

Merge Sort

Divide-and-conquer algorithm; O(n log n).

36
New cards

Comparing Sorts

Merge sort is faster for large data; selection/insertion sorts are easier but less efficient.

37
New cards

Trees

Hierarchical structures with a root and child nodes.

38
New cards

Definitions of Trees

Connected acyclic graphs with one root node.

39
New cards

Properties of Trees

Include height, depth, level, and more; a tree with n nodes has n-1 edges.

40
New cards

Terms (Tree)

Key terms: root, leaf, height, subtree.

41
New cards

Binary Tree

Each node has at most two children.

42
New cards

Terms of Binary Tree

Full, complete, perfect, balanced binary trees.

43
New cards

Balance

Maintains minimal height for efficient operations.

44
New cards

Sorted Binary Trees (BST)

Left child < parent < right child for efficient searching.

45
New cards

Binary Search in a Sorted Array

Splits sorted array at each step; O(log n).

46
New cards

Tree Traversals

Visit each node in different orders: preorder, inorder, postorder.

47
New cards

Detailed Algorithms of Preorder, Inorder, Postorder

Visit patterns to traverse trees.

48
New cards

Examples and Programs of Tree Traversal

Use recursion to implement different traversal methods.

49
New cards

Create a Binary Tree with Given Numbers

Insert numbers following BST rules.

50
New cards

What is a Graph?

A collection of nodes and connections, can be directed/undirected.

51
New cards

Terminologies of Graph

Include vertex, edge, path, and more.

52
New cards

Graph Representations

Using adjacency lists, matrices, or edge lists.

53
New cards

Graph Traversal: DFS / BFS

DFS explores deep, BFS explores level-by-level.