Asymptotics Practice
Introduction
Loops
void throwHalfOfMyItems(int n) {
for (int i = 0; i < n; i += 1) {
if (i % 2 == 0)
throwItem(n);
}
}
void lootShulkerBoxes(int n) {
for (int box = n; box > 0; box -= 1) {
for (int stack = 0; stack < n; stack += 1) {
for (int i = 0; i < 64; i += 1) {
lootItem(i * stack * box);
}
}
}
}

Recursion



Best and Worst Case Runtimes



Challenge Problems
Last updated