Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien 4.2 TrustPilot
logo-home
Resume

Summary Algorithms

Note
-
Vendu
-
Pages
28
Publié le
28-08-2023
Écrit en
2022/2023

The algorithms section of the course can be considered the hardest, in this document there are explanations, summaries and examples of the different algorithms and will cover: Analyzing Algorithms Time Complexity Logarithms Space Complexity Searching Algorithms Sorting Algorithms Path-Finding Algorithms.

Montrer plus Lire moins
Établissement
Cours










Oups ! Impossible de charger votre document. Réessayez ou contactez le support.

École, étude et sujet

Niveau d'études
Editeur
Sujet
Cours

Infos sur le Document

Publié le
28 août 2023
Nombre de pages
28
Écrit en
2022/2023
Type
Resume

Sujets

Aperçu du contenu

Analysis, Design and Comparison of Algorithms:
Analysis of algorithms:
When developing an algorithm, there are 2 different things to check:

 Time complexity
 Space complexity

Time complexity:
The time complexity of an algorithm is how much time it requires to solve a particular problem. The time
complexity is measured using a notation called big-o notation, which shows the effectiveness of the
algorithm. It shows an upper limit for the amount of time taken relative to the number of data elements
given as an input. This is good, because it allows you to predict the amount of time it takes for an
algorithm to finish given the number of data elements.

You can think of this as a graph, as the number of data elements entered against the time taken to
complete the algorithm. This will be helpful for showing the relationships between time and the number
of elements inputted. These are shown below.

Big-O notation is written in the form O(n), where n is the relationship between n: the number of
inputted entities, and O(n) is the time relationship. Below are examples of different big-O notations:

Big-O notation Name Description
O(1) Constant time complexity The amount of time taken to complete an algorithm
is independent from the number of elements
inputted.
O(n) Linear time complexity The amount of time taken to complete an algorithm
is directly proportional to the number of elements
inputted.
O(n2) Polynomial time complexity The amount of time taken to complete an algorithm
is directly proportional to the square of the number
of elements inputted.
O(nn) Polynomial time complexity The amount of time taken to complete an algorithm
is directly proportional to the elements inputted to
the power of n.
O(2n) Exponential time complexity The amount of time taken to complete an algorithm
will double with every additional item.
O(log n) Logarithmic time complexity The amount of time taken to complete an algorithm
will increase at a smaller rate as the number of
elements inputted.
When calculating the time complexity, you should think logically through the algorithms. Below are a
few examples:

Algorithm example Big-O notation
This example is unrelated to the number of items Constant time:
inputted: This will always take the same amount of time to
For example: complete regardless of the number of values
Print(“hello”) inputted.

, This example is directly proportional to the Linear Time Complexity:
number of items inputted: The time taken to complete the algorithm is
For example: related to the number of items inputted.
inuttedValue = [a,b,c,…,n]
for I in range(len(inputtedValue)): The number of operations completed was
print(“hello”) proportional to the inputted value.
This example is proportional to the number of Polynomial Time Complexity:
items inputted: The amount of time taken to complete the
For example: algorithm is proportional to the number of items
inputtedValue[a,b,c…n] inputted to the power of n.
for I in range(len(inputtedValue)):
for I in range(len(inputtedValue)): The power given to the polynomial is the same as
print(“hello”) the number of embedded loops.
This example is exponentially proportional to the Exponential Time Complexity:
number of items inputted: The amount of time taken to complete the
For example: algorithm is proportional to 2 to the power of the
Recursive algorithms that solve a problem of size number of items inputted.
N by recursively solving 2 smaller problems f size
N-1 This is common with recursive algorithms solving
2 smaller problems of size n-1
This example is logarithmically related to the Logarithmic time complexity
number of items inputted:
for example:
a divide and conquer algorithm is a good example
of this, the number of items you have to search
through gets halved each time.
Time Complexity Graphs:
Constant Time Complexity:

, Linear Time Complexity:




Polynomial Time Complexity:




Exponential Time Complexity:
€8,84
Accéder à l'intégralité du document:

Garantie de satisfaction à 100%
Disponible immédiatement après paiement
En ligne et en PDF
Tu n'es attaché à rien

Faites connaissance avec le vendeur
Seller avatar
michaellawther

Document également disponible en groupe

Faites connaissance avec le vendeur

Seller avatar
michaellawther Huddersfield New College
S'abonner Vous devez être connecté afin de suivre les étudiants ou les cours
Vendu
0
Membre depuis
2 année
Nombre de followers
0
Documents
12
Dernière vente
-

0,0

0 revues

5
0
4
0
3
0
2
0
1
0

Récemment consulté par vous

Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions