Relative Content

Tag Archive for algorithm

javascript Bilateral filter algorithm

I am developing Bilateral filter, a skin correction algorithm, using javascript, but it is not working well. If anyone has had success, please send me the code.

How to solve this problem with dynamic programming?

Suppose you have an elevator that only consists of up and down buttons.
It means that it can only go up as much as “up” or go down as much as “down”.
Suppose we want to go from floor A to B. Using the dynamic programming method, write an algorithm that moves from floor A to B with the least number of button presses.
Input: up, down, A, B, and the output is the least number of button presses.

How can I solve this dynamic programming problem?

Parinaz is trapped inside the building elevator due to karma, which can only go from the ground floor (0) to the B floor.
It has two buttons up and down. He wants to go u floor up and d floor down
A is located and needs to reach the level of B as quickly as possible. Using the dynamic programming method, write a program that has the lowest number.

Find amount of subarrays with property

Given array of length n. I need to find amount of subarrays (or amount of pairs 1 <= l <= r <= n) such that OR(a[l], a[l+1], ..., a[r]) > max(a[l], a[l+1], ..., a[r]) for O(nlogn * T), where T = max(a[i]).

Fenwick tree task

I need to implement data structure that can answer for O(logn) to these queries: