








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









Data Structures and Algorithms
public int sum1(int n, int m, int[][] table) { int output = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { output += table[i][j]; } } return output; } public int sum2(int n, int m, int[][] table) { int output = 0; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { output += table[j][i]; } } return output; } What do these two methods do? What is the big-Θ Θ(n*m)
Lies!
CPU Register L1 Cache L2 Cache RAM Disk What is it? Typical Size Time The brain of the computer! 32 bits ≈free Extra memory to make accessing it faster 128KB 0.5 ns Extra memory to make accessing it faster 2MB 7 ns Working memory, what your programs need 8GB 100 ns Large, longtime storage 1 TB 8,000,000 ns