Mods
Data structures
Linux commands
Big O
Potpourri
100

6 % 2

0

100

What data structure does an initialization like:

int my_arr[][] = ...

represent?

A 2D array (array of arrays)

100

Rename a file

mv

100

What's the big-o notation for an algorithm with quadratic complexity?

O(n2)

100

What format specifier (%s, %d, %i, %p, etc) tells printf to expect an integer?

%d

200

12 % 100

12

200

Name a limitation of standard arrays (what's one thing they can't do?)

can't be resized, can't store diverse data types, no built-in size function

200

Move directories

cd

200

About how many computations will a O(n) algorithm perform on a 5,000-element list?

5,000

200

What's a quick way to remember the scope of a variable in C++?

Generally, they only exist within the curly braces they were created in

300

0 % 16

0
300

What do FIFO and LIFO stand for, as they related to stacks and queues?

First in first out, last in last out

300

Move "back" or "up" a directory

cd ..

300

When dealing with logarithmic runtimes, it's not log base 10, but log base _____?

2

300

What's the bug?

printf("Your score on the %f test was %s\n", "math", 85.3);

The %s and %f are swapped

400

84 % 5

4
400

What data structure follows a "last in, first out" paradigm?

Stack

400

Delete a directory

rmdir or rm -r

400

Algorithms with nested for loops usually result in which type of big-o complexity?

O(n2)

400

What is one thing a struct cannot hold?

A function definition!

500

99 % 0

error!

500

What's a vector?

A re-sizeable array!

500

Print the contents of a file to the terminal

cat

500

What does O(logn) tell us about the algorithm it's evaluating?

It splits the problem in 2 over and over again

500

Evaluate:

!(true || !(!(false || !false))) || true

true