Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 63601

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].

1
vote
0answers
I came across a bridge crossing problem. It got me wondering: Can it be reduced to some sort of scheduling problem. If not, is there any other general problem it can be reduced to? Here is the proble …
asked Dec 23 '16 by justinpc
2
votes
We remove the inversions by beginning from the bottom (furthest level from the root) and going breadth-first up. Start at the bottom level. We have a set of leaves, each satisfying the heap propert …
answered Feb 13 by justinpc
5
votes
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
4
votes
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
7
votes
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
6
votes
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 …
asked Jan 17 by justinpc