Skip to main content
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
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
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 not deleted user 13249

An algorithm is a sequence of well-defined steps that defines an abstract solution to a problem. Use this tag when your issue is related to design and analysis of algorithms.

4 votes
Accepted

Designing a prefix code for integers?

The following code is often used as a standard prefix-code for natural numbers, which bounds the length of each codeword by $\log n+O(\log\log n)$: At first, we identify the natural numbers by binary …
Danny's user avatar
  • 994
3 votes
Accepted

Which algorithms have runtime recurrences like $T(n) = \sqrt{n}\,T(\sqrt{n}) + O(n)$?

Think of an algorithm, which do something linear with an integer list of length $n$, for example computes the maximum. Afterwards, the algorithm divides the list of length $n$ into $\sqrt{n}$ lists of …
Danny's user avatar
  • 994
2 votes

Storing the stream in less space

Unfortunately you will always need space $\Omega(nk)$ to support your operations. Consider all possible contents of your stream, i.e. all subsets of $[n]\times [k]$. There are $2^{nk}$ such subsets. …
Danny's user avatar
  • 994
1 vote

Algorithm for random generation of two connected partitions of a finite set

There do not exist such partitions $D_1$ and $D_2$. Recall your assumptions: $$\bigcup\limits_{i=1}^{p} A_i=X,\;\bigcup\limits_{i=1}^{q} B_i=X$$ It follows, that for each $x\in X$ there exists a set $ …
Danny's user avatar
  • 994
1 vote

Which is the proper algorithm to figure repeated substrings of longest total length?

You describe the first step of the "greedy off-line textual substitution" described in Alberto Apostolico, Stefano Lonardi: Off-Line Compression by Greedy Textual Substitution. Proc. IEEE, vol. 88 n …
Danny's user avatar
  • 994
1 vote
Accepted

Cost of find operation on a tree data-structure

Since my two comments already form the solution, I can also write the answer in total. If you have a datastructure consisting of a bunch of trees, then the worst-case cost of a Find-Operation is the …
Danny's user avatar
  • 994
1 vote
Accepted

Understanding a proof in the sweep line algorithm when finding all line segment intersections

The proof is absolutely correct. Of course, the algorithm only computes something when the sweep line comes to an eventpoint. Nevertheless you can think of the sweep line as a continiously moving line …
Danny's user avatar
  • 994