Aujourd'hui :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
void swap(List<String> list, int i, int j) {
    String s1 = list.get(i);
    list.set(i, list.get(j));
    list.set(j, s1);
}
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
Map<Input,Output> cache = …;
Output cachedComputation(Input in) {
    Output out = cache.get(in);
    if (out == null) {
        out = computation(input);
        cache.put(in, out);
    }
    return out;
}
Demain :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
void swap(List<String> list, int i, int j) {
    String s1 = list[i];
    list[i] = list[j];
    list[j] = s1;
}
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
Map<Input,Output> cache = …;
Output cachedComputation(Input in) {
    Output out = cache[in];
    if (out == null) {
        out = computation(input);
        cache[in] = out;
    }
    return out;
}