## Heapsort temporal complexity explained

The heapsort algorithm temporal complexity is O(nlgn). In this post, I’ll explain step-by-step why that is the temporal complexity. We use asymptotic notation to express the running time of an algorithm as a function of the input’s size. As a short reminder, an algorithm’s (theoretical) temporal complexity is the lowest bound for the function that […]

## Temporal complexity of recursive algorithms

We use the big-O notation to calculate the temporal complexity of algorithms. In this post, I’ll show how to calculate the temporal complexity of recursive algorithms. As a reminder, an algorithm is a finite sequence of steps that, when executed in a certain order, solve a problem. A problem is a pair (E, S) where

## Temporal complexity of iterative algorithms

We use the big-O notation to calculate the temporal complexity of algorithms. In this post, I’ll show how to calculate the temporal complexity of iterative algorithms. As a reminder, an algorithm is a finite sequence of steps that, when executed in a certain order, solve a problem. A problem is a pair (E, S) where

## Big-O notation in algorithms

We use big-O notation to describe the growth of functions. In the case of algorithms, we use it to calculate the temporal complexity of an algorithm with respect to the algorithm’s input. We use big-O notation in algorithms, to calculate the theoretical temporal complexity of an algorithm. The main advantage of the big-O notation is

## Example of calculating the practical/real temporal complexity of two algorithms

In this post, I’ll show you an example of how to calculate the practical time complexity of two algorithms that solve the same problem. As you should remember from the previous post, we calculate temporal complexity to assess how efficient an algorithm is compared to another algorithm. By doing this, we can choose the best

## What is the temporal complexity of an algorithm?

The temporal (or time) complexity of an algorithm is a measure of the time the algorithm takes to be executed and give an output, as a function of the size of the input. The time complexity can be calculated in two ways: Practical temporal complexity The practical way depends on the specific implementation of the

## 4. Show that the additive inverse, or negative, of an even number is an even number using a direct proof

Let’s refresh the concept of direct proof. “A direct proof of a conditional statement p → q is constructed when the first step is the assumption that p is true; subsequent steps are constructed using rules of inference, with the final step showing that q must also be true. A direct proof shows that a

## 6- Use a direct proof to show that the product of two odd numbers is odd

“A direct proof of a conditional statement p → q is constructed when the first step is the assumption that p is true; subsequent steps are constructed using rules of inference, with the final step showing that q must also be true. A direct proof shows that a conditional statement p → q is true

## 7. Use a direct proof to show that every odd integer is the difference of two squares.

Let’s refresh the concept of direct proof. “A direct proof of a conditional statement p → q is constructed when the first step is the assumption that p is true; subsequent steps are constructed using rules of inference, with the final step showing that q must also be true. A direct proof shows that a

## 5. Prove that if m + n and n + p are even integers, where m, n, and p are integers, then m + p is even. What kind of proof did you use?

Sometimes, we must attempt different proof methods to prove a certain theorem or complete a certain proof. This is what you will find usually in practice. Think about it, you are doing some research, you think something is true under certain conditions, you create a conjecture, and now you have to prove it. No one