Break it
Every algorithm has inputs it hates. Find them: knowing what breaks an algorithm is how you learn what it relies on.
Make quicksort slow
This quicksort always takes the last value as its pivot. On a random order of 10 values it makes about 24 comparisons. Give it 10 values that make it do the most work it ever can: 45 comparisons.
Need a hint?
A partition is cheap to recurse on when the pivot splits the values evenly. What order makes the last value the worst possible pivot, every time?
Fool the greedy cashier
A greedy cashier makes change by always taking the largest coin that still fits. With real coins that gives the fewest coins. Find an amount where it doesn’t.
Need a hint?
Try amounts just above a big coin. Taking it might leave a remainder that only small coins can make, when two middle-sized coins would have done.
Flood the hash table
This hash table has 8 buckets and puts key k in bucket k mod 8. Keys that land in the same bucket form a chain, and a lookup walks the chain. Choose 8 keys that make one chain as long as it can be.
Need a hint?
Two keys share a bucket when they leave the same remainder after dividing by 8.
Attackers do this to real servers: send keys that all collide and every lookup slows to a scan. That is why real hash tables pick a random, secret (salted) hash function when they start, so nobody can predict which keys collide.