Constant Time Complexity
If any program requires a fixed amount of time for all input values then its time complexity is said to be Constant Time Complexity
Absolute Value Function
The absolute value function returns the distance of a number from zero on the number line, always resulting in a non-negative value.
1/128
p.42
Time Complexity

Constant Time Complexity

If any program requires a fixed amount of time for all input values then its time complexity is said to be Constant Time Complexity

p.4
Floor and Ceiling Functions

Absolute Value Function

The absolute value function returns the distance of a number from zero on the number line, always resulting in a non-negative value.

p.47
Time Complexity

Bubble Sort

Bubble Sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.

p.29
Asymptotic Notations

Θ notation

Θ notation is used to specify both the lower bound and upper bound of the function.

p.48
Insertion Sort - Time Complexity

Bubble sort

A simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order.

p.22
Big O Notation

constant time complexity

Indicates an algorithm that runs in constant time regardless of the input size.

p.25
Asymptotic Notations

THETA

Theta notation, represented by Θ, is used to describe the tight bound of an algorithm's running time. It indicates that the running time of the algorithm is bounded both from above and below by the given function.

p.22
Big Omega Notation

Big Omega notation (Ω) provides _________bound.

The lower bound of an algorithm's time complexity.

p.36
Time Complexity

T(n)

Time requirements can be defined as a numerical function T(n), where T(n) can be measured as the number of steps, provided each step consumes constant time.

p.11
Asymptotic Analysis

Asymptote of a curve

The asymptote of a curve is a line that closely approximates a curve but does not touch the curve at any point of time.

p.27
Remainder Function (Modular Arithmetic)

Remainder Function (Modular Arithmetic)

The remainder function, also known as the modulo operation, returns the remainder of the division of one number by another.

p.12
Asymptotic Notations

Theta notation

Theta notation (θ) is a mathematical notation used to describe both the upper and lower bounds of an algorithm's time complexity in terms of the input size.

p.28
Space Complexity

Space Complexity

Space complexity is a measure of the amount of memory space required by an algorithm to solve a computational problem as a function of the input size.

p.10
Asymptotic Analysis

Average Case

Average time required for program execution.

p.31
Space Complexity

Space Complexity

Space complexity is the total amount of memory space used by an algorithm/program including the space of input values for execution.

p.31
Space Complexity

Space Complexity Formula

The space complexity S(P) of any algorithm P is given by S(P) = C + SP(I), where C is the fixed part and S(I) is the variable part of the algorithm which depends on instance characteristic I.

p.9
Big O Notation

Big O

Big O notation is used to describe the upper bound of an algorithm's time complexity in the worst-case scenario.

p.38
Asymptotic Analysis

Count Variable Method

A method used in asymptotic analysis to count the number of times a certain operation is executed in an algorithm.

p.49
Time Complexity

algorithms

Algorithms are a set of well-defined instructions for solving a problem or accomplishing a task. They can be represented using pseudocode, flowcharts, or programming languages.

p.22
Big O Notation

Big oh notation is used to describe __________

The upper bound of an algorithm's time complexity.

p.11
Asymptotic Analysis

Best case scenario

The best case scenario of an algorithm refers to the minimum possible time or space required for the algorithm to complete its execution.

p.11
Asymptotic Analysis

Worst case scenario

The worst case scenario of an algorithm refers to the maximum possible time or space required for the algorithm to complete its execution.

p.21
Asymptotic Analysis

Transitive Property

The property that states if f(n) is O(g(n)) and g(n) is O(h(n)), then f(n) is O(h(n)).

p.1
Remainder Function (Modular Arithmetic)

Remainder Function (Modular Arithmetic)

The remainder function, also known as the modulo operation, returns the remainder of the division of one number by another.

p.27
Asymptotic Analysis

Asymptotic Analysis

Asymptotic analysis is a method for describing the limiting behavior of a function when the argument tends towards a particular value or infinity.

p.5
Summation Symbol (Sums)

What is the purpose of the Summation Symbol?

The Summation Symbol is used to represent the sum of a series of numbers or terms.

p.5
Summation Symbol (Sums)

How is the Summation Symbol denoted?

The Summation Symbol is denoted by the Greek letter sigma (∑).

p.15
Big O Notation

Big-Oh Notation

A mathematical notation that describes the upper bound of an algorithm's time complexity in terms of how it scales with the size of the input.

p.15
Big O Notation

t(n)

A function representing the time complexity of an algorithm, where n is the size of the input.

p.49
Time Complexity

time complexity

The time complexity of an algorithm is a measure of the amount of time it takes to run as a function of the length of the input. It gives an upper bound on the running time in terms of the input size.

p.20
Insertion Sort - Time Complexity

Quadratic Running time

O(n2)

p.39
Floor and Ceiling Functions

frequency

Frequency is defined as the total number of times each statement is executed.

p.11
Asymptotic Analysis

Asymptotic analysis

Asymptotic analysis of an algorithm refers to defining the mathematical boundation/framing of its run-time performance.

p.22
Asymptotic Analysis

T1(n).T2(n)

T1(n) * T2(n)

p.36
Time Complexity

c

c is the time taken for addition of two bits.

p.1
Floor and Ceiling Functions

Floor and Ceiling Functions

The floor function returns the largest integer less than or equal to a given number, while the ceiling function returns the smallest integer greater than or equal to a given number.

p.27
Summation Symbol (Sums)

Summation Symbol (Sums)

The summation symbol, often denoted by the Greek letter sigma, represents the addition of a sequence of numbers or terms.

p.12
Asymptotic Notations

Little-oh notation

Little-oh notation (o) is a mathematical notation used to describe the upper bound of an algorithm's time complexity in terms of the input size, excluding the exact bound.

p.28
Time Complexity

Time Complexity

Time complexity is a measure of the amount of time required by an algorithm to solve a computational problem as a function of the input size.

p.10
Asymptotic Analysis

Best Case

Minimum time required for program execution.

p.24
Asymptotic Notations

THETA

Represents the tight bound of a function, denoting both the upper and lower bounds.

p.19
Insertion Sort - Time Complexity

Linear running time

O(n)

p.17
Big Omega Notation

Big-Omega notation

Big-Omega notation (Ω) is used to describe the best-case scenario of an algorithm's time complexity. It represents the lower bound of the running time of an algorithm.

p.16
Asymptotic Notations

Big-Omega notation

A function t(n) is said to be in Ω(g(n)), denoted as t(n) ϵ Ω(g(n)), if t(n) is bounded below by some positive constant multiple of g(n) for all large n. i.e., there exist some positive constant c and some non-negative integer n0. Such that t(n) ≥ cg(n) for all n ≥ n0. It represents the lower bound of the resources required to solve a problem.

p.43
Asymptotic Analysis

Time required for this algorithm

proportional to n

p.44
Asymptotic Analysis

Total Cost

The sum of c1, c2, (n+1)*c3, n*c4, n*(n+1)*c5, n*n*c6, n*n*c7, and n*c8

p.44
Asymptotic Analysis

Time required for this algorithm

Proportional to n^2

p.25
Asymptotic Notations

Θ(n2 )

The notation Θ(n2 ) signifies that the running time of an algorithm grows at the same rate as n2, within a constant factor. It provides a tight bound on the algorithm's time complexity.

p.21
Big Omega Notation

Ω(g(n))

The set of functions that grow at least as fast as g(n) for sufficiently large n.

p.21
Asymptotic Analysis

Reflexive Property

The property that states a function f(n) is always O(f(n)).

p.12
Asymptotic Notations

Big-Oh notation

Big-Oh notation (O) is a mathematical notation used to describe the upper bound of an algorithm's time complexity in terms of the input size.

p.28
Big O Notation

Big O Notation

Big O notation is used to describe the upper bound of an algorithm's time complexity in terms of how it grows relative to the size of the input.

p.1
Space Complexity

Space Complexity

Space complexity is a measure of the amount of memory space required by an algorithm to solve a computational problem as a function of the input size.

p.24
Asymptotic Notations

Asymptotic Notation

A mathematical notation used to describe the limiting behavior of a function when the argument tends towards a particular value or infinity.

p.30
Time Complexity

Complexity

The measure of the amount of resources required to perform a particular algorithm or operation, such as time, space, or both.

p.30
Time Complexity

Time-Space Trade Off

The concept of sacrificing space to reduce the time complexity of an algorithm, or sacrificing time to reduce the space complexity.

p.43
Asymptotic Analysis

Total Cost

c1 + c2 + (n+1)*c3 + n*c4 + n*c5

p.34
Space Complexity

Space Complexity

The amount of memory space required by an algorithm or program to execute as a function of the input size. In this case, it is calculated as size(a) + size(b) + size(c), where sizeof(int) = 2 bytes, resulting in 6 bytes. Therefore, the space complexity is O(1) or constant.

p.29
Floor and Ceiling Functions

positive value function

The function that gives the positive value of the given input.

p.29
Remainder Function (Modular Arithmetic)

K (mod) M

K (mod) M gives the reminder of K divided by M.

p.22
Big O Notation

Big O Notation is a _________function used in computer science to describe an ____________

Mathematical function, algorithm's time complexity.

p.36
Time Complexity

Time Complexity

Time Complexity of an algorithm represents the amount of time required by the algorithm to run to completion.

p.21
Asymptotic Notations

θ(g(n))

The set of functions that grow at the same rate as g(n) for sufficiently large n.

p.27
Floor and Ceiling Functions

Floor and Ceiling Functions

The floor function returns the largest integer less than or equal to a given number, while the ceiling function returns the smallest integer greater than or equal to a given number.

p.12
Asymptotic Notations

Big-Omega notation

Big-Omega notation (Ω) is a mathematical notation used to describe the lower bound of an algorithm's time complexity in terms of the input size.

p.28
Big Omega Notation

Big Omega Notation

Big Omega notation is used to describe the lower bound of an algorithm's time complexity in terms of how it grows relative to the size of the input.

p.27
Time Complexity

Time Complexity

Time complexity is a measure of the amount of time required by an algorithm to solve a computational problem as a function of the input size.

p.8
Floor and Ceiling Functions

Logarithms

Logarithms are the inverse operation to exponentiation. They indicate the power to which a base must be raised to produce a given number.

p.19
Insertion Sort - Time Complexity

Best Case

The best case occurs if the array is already sorted, tj=1 for j=2,3…n.

p.18
Big Omega Notation

Big-Omega notation

Big-Omega notation (Ω) is used to describe the lower bound of an algorithm's time complexity. It represents the minimum time required for an algorithm to run in relation to the input size.

p.18
Asymptotic Analysis

t(n)

t(n) is a function that represents the time complexity of an algorithm. In this context, t(n) = 2n + 3.

p.33
Space Complexity

array

A data structure that stores a collection of elements, each identified by at least one array index or key.

p.39
Floor and Ceiling Functions

s/e

The s/e of a statement is the amount by which the count changes as a result of the execution of that statement.

p.15
Big O Notation

g(n)

A function used in Big-O notation to represent the scaling behavior of an algorithm's time complexity with respect to the size of the input.

p.39
Floor and Ceiling Functions

step count

Combining s/e and frequency, the step count for the entire algorithm is obtained.

p.32
Space Complexity

Space Complexity

Space complexity is a measure of the amount of memory space required by an algorithm to execute in terms of the input size. It is calculated by considering the total space required to store the data used in the program, including the size of variables and any additional space needed.

p.32
Space Complexity

O(1)

O(1) denotes constant space complexity, indicating that the amount of memory space required by the algorithm does not increase with the size of the input.

p.21
Asymptotic Analysis

Symmetric Property

The property that states if f(n) is θ(g(n)), then g(n) is also θ(f(n)).

p.28
Summation Symbol (Sums)

Summation Symbol (Sums)

The summation symbol represents the addition of a sequence of numbers, often denoted as the Greek letter sigma (∑).

p.1
Big O Notation

Big O Notation

Big O notation is used to describe the upper bound of an algorithm's time complexity in terms of how it grows with respect to the size of the input.

p.27
Space Complexity

Space Complexity

Space complexity is a measure of the amount of memory space required by an algorithm to solve a computational problem as a function of the input size.

p.26
Asymptotic Notations

THETA

Theta is a notation used in the analysis of algorithms to describe the tight bound of the running time. It represents the average case time complexity of an algorithm.

p.7
Asymptotic Analysis

Permutations

Permutations refer to the arrangement of objects in a specific order. In mathematics, it is denoted by nPr, where n represents the total number of items and r represents the number of items taken at a time.

p.35
Space Complexity

Space Complexity

The space complexity of the program is O(n) or linear, as the space occupied by the array and integer variables is 4n + 12 bytes.

p.37
Time Complexity

Count variable method

A method used to find the time complexity for an algorithm by counting the number of basic operations executed in the algorithm.

p.15
Big O Notation

c

A constant value used in Big-O notation to represent the scaling factor of the upper bound of an algorithm's time complexity.

p.33
Space Complexity

integer

A data type used to represent whole numbers, which can be positive, negative, or zero.

p.49
Time Complexity

table method

The table method is a technique used to analyze and calculate the time complexity of algorithms by creating a table to track the number of operations performed at each step of the algorithm.

p.29
Big O Notation

Big O Notation

Big O Notation is used to specify the upper bound of the function.

p.32
Space Complexity

Integer Data Type

The integer data type is a data type that represents whole numbers. In this example, the size of the integer data type is assumed to be 4 bytes, which depends on the architecture of the system (compiler).

p.36
Time Complexity

Linear Growth

T(n) grows linearly as input size increases.

p.28
Remainder Function (Modular Arithmetic)

Remainder Function (Modular Arithmetic)

The remainder function, also known as the modulo operation, returns the remainder of the division of one number by another.

p.1
Asymptotic Analysis

Asymptotic Analysis

Asymptotic analysis is a method for describing the limiting behavior of a function when the argument tends towards a particular value or infinity.

p.27
Big Omega Notation

Big Omega Notation

Big Omega notation is used to describe the lower bound of an algorithm's time complexity in terms of how it grows relative to the size of the input.

p.4
Floor and Ceiling Functions

Integer

An integer is a whole number that can be positive, negative, or zero, and does not have a fractional or decimal part.

p.23
Asymptotic Notations

Asymptotic Notation

Asymptotic notation is a mathematical notation used to describe the limiting behavior of a function when the argument tends towards a particular value or infinity.

p.23
Asymptotic Notations

Theta Mathematical Functions

Theta notation is used to describe the behavior of a function in terms of both upper and lower bounds, providing a precise description of the growth rate of the function.

p.20
Insertion Sort - Time Complexity

Worst case

If the array is in reverse sorted order

p.31
Space Complexity

Example of Space Complexity Calculation

In the algorithm SUM(A, B), the space complexity S(P) is calculated as 1+3, where 1 represents the constant and 3 represents the variables A, B, and C.

p.9
Big Omega Notation

Big Omega

Big Omega notation is used to describe the lower bound of an algorithm's time complexity in the best-case scenario.

p.33
Space Complexity

space complexity

The amount of memory space required by an algorithm or program to solve a computational problem as a function of the size of the input.

p.25
Time Complexity

n2 /2 – 2n

The function n2 /2 – 2n represents the running time of an algorithm. It is used to analyze the time complexity of the algorithm and compare it with other functions to determine its growth rate.

p.21
Big O Notation

O(g(n))

The set of functions that grow no faster than g(n) for sufficiently large n.

p.11
Asymptotic Analysis

Theory of approximation

The theory of approximation is related to the behavior of an algorithm when the input size increases, and it involves deriving the best, average, and worst case scenarios of the algorithm.

p.21
Asymptotic Analysis

Transpose Property

The property that states if f(n) = O(g(n)), then g(n) is Ω(f(n)).

p.28
Asymptotic Analysis

Asymptotic Analysis

Asymptotic analysis is a method for describing the limiting behavior of a function when the argument tends towards a particular value or infinity.

p.1
Big Omega Notation

Big Omega Notation

Big Omega notation is used to describe the lower bound of an algorithm's time complexity in terms of how it grows with respect to the size of the input.

p.1
Insertion Sort - Time Complexity

Insertion Sort - Time Complexity

The time complexity of the insertion sort algorithm is O(n^2) in the worst case, where n is the number of elements being sorted.

p.13
Big O Notation

Big-Oh Notation (O)

A function t(n) is said to be in O(g(n)), denoted as t(n) ϵ O(g(n)), if t(n) is bounded above by some constant multiple of g(n) for all large n. i.e., if there exist some positive constant c and some non-negative integer n0 such that t(n) ≤ cg(n) for all n ≥ n0

p.3
Remainder Function (Modular Arithmetic)

Remainder Function

The remainder function, also known as modular arithmetic, calculates the remainder of the division of one number by another.

p.2
Floor and Ceiling Functions

Floor and Ceiling Functions

The floor function returns the largest integer less than or equal to a given number, while the ceiling function returns the smallest integer greater than or equal to a given number.

p.10
Asymptotic Analysis

Worst Case

Maximum time required for program execution.

p.14
Big O Notation

Big-Oh Notation

Big-Oh notation is used to describe the upper bound of an algorithm's time complexity in terms of the input size.

p.45
Insertion Sort - Time Complexity

Insertion Sort

Insertion sort is a simple sorting algorithm that builds the final sorted array one item at a time. Its time complexity is O(n^2) in the worst case, where n is the number of elements in the array.

p.37
Time Complexity

Table method

A method used to find the time complexity for an algorithm by creating a table to track the number of operations executed at each step of the algorithm.

p.48
Insertion Sort - Time Complexity

Insertion sort

A simple sorting algorithm that builds the final sorted array one item at a time.

p.29
Asymptotic Analysis

possible permutation

For a given set of number n, the number of possible permutation will be equal to the factorial value of n.

p.11
Asymptotic Analysis

Average case scenario

The average case scenario of an algorithm refers to the expected time or space required for the algorithm to complete its execution when given an average input.

p.11
Asymptotic Analysis

Input bound

Asymptotic analysis is input bound, meaning it specifies the behavior of the algorithm when the input size increases.

p.28
Floor and Ceiling Functions

Floor and Ceiling Functions

The floor function returns the largest integer less than or equal to a given number, while the ceiling function returns the smallest integer greater than or equal to a given number.

p.1
Summation Symbol (Sums)

Summation Symbol (Sums)

The summation symbol, denoted by the Greek letter sigma, represents the sum of a series of terms in mathematics.

p.27
Big O Notation

Big O Notation

Big O notation is used to describe the upper bound of an algorithm's time complexity in terms of how it grows relative to the size of the input.

p.1
Time Complexity

Time Complexity

Time complexity is a measure of the amount of time required by an algorithm to solve a computational problem as a function of the input size.

p.12
Asymptotic Notations

Little-omega notation

Little-omega notation (ω) is a mathematical notation used to describe the lower bound of an algorithm's time complexity in terms of the input size, excluding the exact bound.

p.27
Insertion Sort - Time Complexity

Insertion Sort - Time Complexity

The time complexity of the insertion sort algorithm is O(n^2) in the worst case, where n is the number of elements being sorted.

p.28
Insertion Sort - Time Complexity

Insertion Sort - Time Complexity

The time complexity of the insertion sort algorithm is O(n^2) in the worst case, where n is the number of elements being sorted.

p.8
Floor and Ceiling Functions

Exponents

Exponents are a mathematical notation that indicates the number of times a number is multiplied by itself.

p.6
Floor and Ceiling Functions

Factorial Function

The factorial function is a mathematical function denoted by the symbol '!', which takes a non-negative integer as input and returns the product of all positive integers less than or equal to the input.

Study Smarter, Not Harder
Study Smarter, Not Harder