100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4.2 TrustPilot
logo-home
Samenvatting

Summary Algorithms and Data structures in Python

Beoordeling
4,0
(2)
Verkocht
9
Pagina's
83
Geüpload op
16-10-2018
Geschreven in
2018/2019

This summary contains all the information of the Lectures and the slides of the lectures the wednesday tutorials with examples of codes. This is a summary of the subject Algorithms and data structures in Python at The University of Amsterdam.

Meer zien Lees minder











Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Documentinformatie

Geüpload op
16 oktober 2018
Aantal pagina's
83
Geschreven in
2018/2019
Type
Samenvatting

Onderwerpen

Voorbeeld van de inhoud

Lecture 1:
You got 2 types of knowledge:

Declarative knowledge = statement of fact
Imparative knowledge = a recipe or “how to”
This is used by machines. “Machines are stupid”

Recipe -> 1. Sequence of simple steps.
2. Flow of control process that specifies when each step is executed.
3. A means of determining when …

Computers

You got two different kind of computers:

- Fixed program computer (calculator)
- Stored program computer (machine stores)
Basic machine architecture




Basic primitives

Tuning -> Compute anything using 6 primitives
- Right
- Left
- Read
- Wright
- Scan
- Do nothing

Nowadays, modern programming have more primitives. We can even use abstract methods to
create knew primitives.
! Anything that is computable in one programming language is computable in any other
programming language.




Pagina 1 van 83

,Creating recipes

- A programming language provides a set of primitive operations
- Expressions are complex but legal combinations of primitives in a programming language
- Expressions and computations have values and meanings in a programming language

Languages

You have different kind of languages. For instance english consists of words while programming
language consists of strings, floats, integers, booleans etc.

String = “Hello” -> words ()
Integer = 256 -> hele nummers ()
Float = 8.5 -> komma getallen ()
List = [1,2,3,4,] -> een lijst aan strings, integers, floats etc. [ ] (tuple is same but with ( ) )
Dictionary = { “a” = “apple”, “b” = “banana”} { }
Boolean = TRUE, FALSE

Om te zien wat voor type een bepaalde variable is: type(“Hello”) = <type ‘str’>




- Syntatic errors, are errors which are common and easily caught.
- Static semantic error = Some languages check for these before running the program
Can cause unpredictable behavior




Pagina 2 van 83

,Sometimes you don’t get any semantic errors but the programmer get different meaning then
intended.
- Program crashes
- Program runs forever
- Program gives answer but different then expected

Python programs

A program is sequence of definitions and commands.
- Definitions are evaluated
- Commands are executed by python interpreter by shell
Commands (statements) instruct interpreter to do something.
These can be typed directly in a shell or stored in a file that is read into the shell and
evaluated.

Objects

Programs manipulate data objects.

Object have a type that define things programs can do to them
◦ Ana is a human so she can walk, speak English, etc.
Objects can be scalar or non scalar

Scalar objects:

String = “Hello” -> words ()
Integer = 256 -> hele nummers ()
Float = 8.5 -> komma getallen ()
List = [1,2,3,4,] -> een lijst aan strings, integers, floats etc. [ ] (tuple is same but with ( ) )
Dictionary = { “a” = “apple”, “b” = “banana”} { }
Boolean = TRUE, FALSE
Non type = Special and has one value, None

Can convert object of one type to another
Float(3) converts integer 3 to float 3.0
Int(3.9) truncates float 3.9 to integer 3

Use print( ) to print something.

Expressions

- Combine objects and operators to form expressions.
- An expression has a value, which has a type.
- Simple expression: <object <operator> <object>




Pagina 3 van 83

, Simple operations

Radius = Radius + 1 == Radius +=1

On the left is the variable name, on the right are equivalent to a value.


Binding variables and values




Abstracting expressions

We give names to value of expression, this is so we can reuse the names instead of the values.
This makes it easier to change the codes in a later stadium in it will provide a clean code.




Pagina 4 van 83

Beoordelingen van geverifieerde kopers

Alle 2 reviews worden weergegeven
3 jaar geleden

6 jaar geleden

4,0

2 beoordelingen

5
1
4
0
3
1
2
0
1
0
Betrouwbare reviews op Stuvia

Alle beoordelingen zijn geschreven door echte Stuvia-gebruikers na geverifieerde aankopen.

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
joannavoortman Vrije Universiteit Amsterdam
Bekijk profiel
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
46
Lid sinds
8 jaar
Aantal volgers
38
Documenten
0
Laatst verkocht
8 maanden geleden

3,4

7 beoordelingen

5
3
4
1
3
1
2
0
1
2

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen