Pergunta de entrevista da empresa Google

Write a recursive function to calculate pascal's pyramid numbers. (Actually easy). Also open-ended knowledge questions.

Resposta da entrevista

Sigiloso

9 de out. de 2014

int pascal(int row, int col) { if (col == 0 || col == row) { return 1; } else { return pascal(row - 1, col - 1) + pascal(row - 1, col); } } Int main() { //print…}

1