# Search Results

Results tagged with Search options user 63601
6 results

The amount of time resources (number of atomic operations or machine steps) required to solve a problem expressed in terms of input size. If your question concerns algorithm analysis, use [tag:runtime-analysis] instead. If your question concerns whether or not a computation will *ever* finish, use [tag:computability] instead. Time-complexity is perhaps the most important sub-topic of [tag:complexity-theory].

A variation of a solution left by a commenter called Vince Given input $a = <a_1, ..., a_n>$. Allocate result array $b = <b_1, \ldots, b_n>$. Set $product = 1$. For $i \in [1, n]$, set $b_i = produ … answered Feb 12 by justinpc My in-place$O(nlogn)$time,$O(logn)$additional space solution Let$a = <a_1, ..., a_n>$. Define the function$\operatorname{f}(\texttt{start}, \texttt{end}) : \texttt{int}$.$\texttt{start}$and … answered Feb 12 by justinpc This is an example of a dynamic algorithm. I will adapt the algorithm in the link, as I don't think that it is written in the most helpful way. Initialise sum = 0 and maxLen = 0. Create a hash table … answered Feb 12 by justinpc 2answers Question: I am trying to solve question 6.10.1 from Elements of Programming Interviews. The task is as follows: Given an array$<a_1, \ldots, a_n>\$ of fixed-length ints, devise an algorithm which ret …