Pagini recente » Project management | Sum | Atasamentele paginii Tije | high_level_contest | Diferente pentru blog/meet-in-the-middle intre reviziile 114 si 113
Nu exista diferente intre titluri.
Diferente intre continut:
Let's go through a few applications.
h2. 4sum (popular interview question)
h2. 4sum
bq. Given A, an array of integers, find out if there are any four numbers in the array that sum up to zero (the same element can be used multiple times). For example given A = [2, 3, 1, 0, -4, -1] a solution is 3 + 1 + 0 - 4 = 0 or 0 + 0 + 0 + 0 = 0.
bq. Given A, an array of integers, find out if there are any four numbers in the array that sum up to zero (the same element can be used multiple times). For example given A = [2, 3, 1, 0, -4, -1] a solution is 3 + 1 + 0 - 4 = 0 or 0 + 0 + 0 + 0 = 0.
4sum is one of the most popular programming interview questions.
The naive algorithm checks all four number combinations. This solution takes $O(N^4^)$ time.
Nu exista diferente intre securitate.
Topicul de forum nu a fost schimbat.