![]() |
|
![]() ![]() ![]() |
|
Aviral20 |
|
|||
Новичок Профиль Группа: Участник Сообщений: 14 Регистрация: 21.2.2023 Репутация: нет Всего: нет |
I'm trying to understand when to use memoization in Python, even though I'm able to implement it when necessary.
How would you identify overlapping subcalls in a recursive function during a coding interview? Would you draw out all the calls (even if some of them go 5-6 levels deep in an O(2^n) complexity brute force solution)? Cases like the Fibonacci sequence make sense because the overlap happens immediately (the 'fib(i-1)' call will almost immediately overlap with the 'fib(i-2)' call). But for other cases, like the knapsack problem, I still can't wrap my head around how anyone can identify that memoization should be used while at an interview. Is there a quick way to check for an overlap? I took online reference from here: https://www.interviewbit.com/manual-testing...view-questions/ I hope my question makes sense. If someone could point me to a good resource, or give me clues to look for, I would really appreciate it. Thanks in advance. |
|||
|
||||
hotpotothers |
|
|||
Новичок Профиль Группа: Участник Сообщений: 6 Регистрация: 2.3.2023 Репутация: нет Всего: нет |
Требуется мужество, чтобы сесть и сделать эту работу. Похлопайте себя по плечу и помните, что вы удивительный человек.
|
|||
|
||||
![]() ![]() ![]() |
Правила форума «Функциональные языки: общие вопросы» | |
|
Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Void. |
1 Пользователей читают эту тему (1 Гостей и 0 Скрытых Пользователей) | |
0 Пользователей: | |
« Предыдущая тема | Функциональные языки: общие вопросы | Следующая тема » |
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |