Professional Documents
Culture Documents
Advanced Algorithms - Assignment 1: Instructions
Advanced Algorithms - Assignment 1: Instructions
Instructions:
● This document must be submitted along with your implementation file.
● You are required to run at least 3 test cases with your implementation and
fill in the tables given.
● You may add more columns in case you have run more test cases
● Reallocation threshold is the percentage of the array filled after which your
implementation reallocates memory
● Deallocation threshold is the percentage of the array emptied after which
your implementation deallocates memory.
● Vary the thresholds in the test cases and note the time taken for the basic
operation
● The final section is optional and can be used if you would like to give the
evaluators additional information about your assignment
Reallocation 1 1 0.5
Threshold
Number of times 9 13 11
copy was called
Number of times 9 13 11
copy was called
3) Splay Tree
Number of 67 63 71
rotations
4) Additional details:
For dynamic table in both implementations I’m first checking the size
against the capacity (and shrinking array if needed) followed by deletion,
instead of first deleting then shrinking the array, moreover:
Test 1: New capacity= ½ * original capacity, N(pushes) = N(pops) = 25
Test 2: New capacity = ¾ * original capacity, N(pushes) = N(pops) = 25
Test 3: New capacity= ½ * original capacity, N(pushes) = N(pops) = 25