Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 16 pages
Summary

Samenvatting - Algorithmen en Datastructuren I

Document preview thumbnail
Preview 3 out of 16 pages

Samenvatting van het vak Algo en Data 1 in 1Ba op de Vrije Universiteit Brussel. Met belangrijke bewijzen

Content preview

Samenvatting AD1
Is voor het grootste deel in order van de hoofdstukken, maar niet helemaal
--> felt like starting w some datastructures

Heaps:
Use cases

Top K problems (min 10 elements of 10 list)n




Minheap maxheap
Dynamic data / streaming: quick insertions and deletes
Shortest path: keep track of only closest
Memory management: free list of memory blocks in RAM

Why it's better than just sorting a list for the first elements ^^


Operation Sorted List Heap (Priority Queue)
Build/Initial Setup O(N log N ) O(N )


Get Min/Max O(1) O(1)


Insert New Element O(N ) (must shift elements) O(log N )


Remove Min/Max O(N ) (must shift elements) O(log N )




Heapify: O(n)
= from-scheme-vector = bottom-up construeren met sift-down
--> de naïeve heapify van nlog(n) is gewoon alles inserten met sift
Visuele voorstelling: volledige binaire boom




MAAR! In realiteit is het een vector

,Adding shit:
Add to last part
Sift-up (swap with parent) until it's in the right place
gg

Deleting shit:

, Remove root
Put last element into root
Sift last element down (picking smallest to swap w always)
gg

Stack:
LIFO
push pop top
performantie beide vectorieel en linked list O(1)
--> kies op vlak van flexibiliteit vs memory

Queue:
FIFO
serve = pop (denk grocery store, ge served een customer)
enqueue = push
peek = top
performantie beide vectorieel en linked list O(1)

Priority Queue:
HPFO: highest priority first out
Dit kan gemaakt worden met positional list, sorted list, etc.
Maar op basis van heap is het beste --> enqueue/serve O(log n)
peek = highest prio element bekijken

proceduretype = combinatie input datatypes outputdatatypes




ascii: 48 --> 0
ascii: 65 --> A
ascii: 97 --> a

Document information

Study
Uploaded on
February 16, 2026
Number of pages
16
Written in
2025/2026
Type
Summary
$5.93

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
thord09
4.0
(1)
Sold
1
Followers
0
Items
3
Last sold
3 weeks ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions