ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Общий форум

Dynamic Programming-Google question
Послано anish 10 июн 2013 22:10
Given an array of integers. Find two disjoint contiguous sub-arrays such that the absolute difference between the sum of two sub-array is maximum.
* The sub-arrays should not overlap.

example- array [2, -1, -2, 1, -4, 2, 8]
answer - first (-1 -2 1 -4) Second (2 8), Maximum difference = (10-(-6)) 16.

Can you please provide recurrence relation for Dynamic Programming to solve this?It would be nice if it is accompanied with explanation.

Re: Dynamic Programming-Google question
Послано Mahammad Valiyev 11 июн 2013 19:36

Edited by author 12.06.2013 00:01

Edited by author 12.06.2013 00:01
Re: Dynamic Programming-Google question
Послано Mahammad Valiyev 11 июн 2013 20:37
But you can do it in N^4 time also by using brute force , You appear this question during interview process ?
Re: Dynamic Programming-Google question
Послано Mahammad Valiyev 12 июн 2013 00:01