Data structures and algorithms, Thesis of Data Structures and Algorithms

Data structures and algorithms 2025

Typology: Thesis

2024/2025

Available from 05/24/2025

Henryjohn
Henryjohn 🇺🇸

9 documents

1 / 69

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45

Partial preview of the text

Download Data structures and algorithms and more Thesis Data Structures and Algorithms in PDF only on Docsity!

Algorithms and Data Structures This minisite contains notes taken by Chris Northwood whilst studying Computer Science at the University of York between 2005-09 and the University of Sheffield 2009-10. They are published here in case others find them useful, but | provide no warranty for their accuracy, completeness or whether or not they are up-to-date. The contents of this page have dubious copyright status, as great portions of some of my revision notes are verbatim from the lecture slides, what the lecturer wrote on the board, or what they said. Additionally, lots of the images have been captured from the lecture slides. Problems and Solutions A problem is a description of the: ¢ assumptions on the inputs e requirements on the outputs A solution is a description of an algorithm and associated data structures that solve that problem, independant of language. e.g., given a non-negative integer n, calculate output: . You could solve this: e s_0 fori—-1ton dos~stfé e Ss. nx (n+ 1)/2 e ifdp.n=2p then s — n/2 S—sx(nt1) else s — (n+ 1)/2 S—xXXxNn Are these correct? If we assume they are, better than others is by measuring resource usage. For our solution: T1 = An: (2i+a+ On+ (2a+ ft) andT2=T3 = An: m+i+d. sis the time to increment by 1, ais the time to assign a value, fis the time to perform the loop test, mis the time to multiply two numbers and dis the time to divide by 2. Therefore, we can see that the time resource usage for the second and third algorithms is constant and for the first algorithm it is linear. If we plotted a graph of T1 against T2 (and T3) we see that for a finite value of nthen T1 has less usage, but for an infinite value of n T1 has greater usage. From this, we can assume that either T2 or T3 are the better algorithms. Jime v1 T2, T3 Asymptotic Complexity dn0,c. n0]©N*ceERt+* Yn.n0 s. Linear Priority Queues Bags of items Bags are sometimes called multisets. They are similar to sets. Sets have members, but bags have the same member more than once (multiplicity) - however order is not important so it is not a series.