Relative Content

Tag Archive for algorithm

Algorithm Divide and Conquer Maximum Subarray

An IT company wants to perform an analysis of revenues and expenses
of in a period of n months. The information is given in a list A[1], . . . , A[n] with
integer values. In month i the company had a deficit or surplus which corresponds to someone
positive or negative integer in position A[i]. The goal is to find a continuous interval
months with the maximum total profit for the company. Here are three examples:
(aʹ) A = [30, −50, 20, −50], where the interval with maximum total profit is from month
1 until month 1, with a profit of 30,
(bʹ) A = [30, −5, 20, −50], where the interval with maximum total profit is from month
1 until month 3 with a total profit equal to 45,
(cʹ) A = [30, −50, 20, −5, 40], where the interval with maximum total profit is from
month 3 up to month 5 with a total profit equal to 55.
Design an efficient divide and conquer algorithm. To
analyze for correctness and complexity, describing and solving the retro-
bit relation that expresses the time complexity of your algorithm.

What is a good algorithm for placement of text labels near objects?

I have a rectangular map filled with objects of different sizes which each have a corresponding text label that must be placed as close to them as possible while not overlapping with any text labels or objects. The text can also be rotated 90 degrees if needed.
The specific case involves placement of text on a pcb board, where the objects are components and the text labels are there names.

How to toggle between buffered (hidden) video and rendered video in this context?

I have a complicated react app dealing with video streams, but this question can boil down to something a lot simpler. Basically, I need to buffer a video “in the background”, using a hidden div (don’t ask me why), and meanwhile display the current video. Then it cycles through n number of videos every few seconds, buffering the next video while the current video plays.