instruction stringlengths 0 29.8k ⌀ |
|---|
|algorithms|arrays|constraint-programming|subsequences| |
|algorithms|arrays|subsequences| |
|algorithms|arrays|subsequences| |
|algorithms|optimization|greedy-algorithms|subsequences| |
In radix sort we first sort by least significant digit then we sort by second least significant digit and so on and end up with sorted list.
Now if we have list of $n$ numbers we need $\log n$ bits to distinguish between those number. So number of radix sort passes we make will be $\log n$. Each pass takes $O(n)$ t... |
Why is Radix Sort $O(n)$? |
|algorithms|sorting| |
I have a forest, i.e., nodes with directed edges and no cycles (directed or undirected). I define the height of a vertex $v$ as 0 if it does not have any incoming edges, or the maximum number of edges to traverse in reverse to reach a vertex of height 0.
![enter image description here][1]
I also know that the aver... |
Be careful with your analysis: what do you assume to make sorting run in $O(n)$ time? This is because each of your digits are in a range from $0$ to $k-1$, meaning your digits can take on $k$ possible values. You need a stable sorting algorithm, so you can for example choose counting sort. Counting sort runs in $\Theta... |
null |
null |
I have a simple problem, but--am so new, I can't seem to even find the right search terms to get me pointed in the direction I need to be heading.
I'm writing a bunch of integers to disk. Lot's of them.
Starting with the integer 2, I add it to another integer, write the result to disk, and start the process again... |
Calculate storage requirements for a data set |
|integers|storage| |
See the definition of [NP completeness][1]. For a problem to be NP-complete, it
1. needs to be in NP and
2. all NP problems need to be reducible to it in polynomial time.
Condition 2 alone is what it means to be NP hard. Thus NP complete problems are the intersection of NP problems and NP hard problems.
... |
I am currently reading the IEEE paper [A Memory-Efficient Parallel String Matching
Architecture for High-Speed Intrusion Detection][1] by Kai Zheng, Bin Liu, Xin Zhang, and Yunhao Liu.
In the paper they propose a model for
a memory-efficient multiple-character-approaching architecture
consisting of multiple ... |
Could I simulate the implementation of memory components |
|computer-architecture|simulation| |
null |
I have a simple problem. I can't seem to even find the right search terms to get me pointed in the direction I need to be heading.
I'm writing a bunch of integers to disk. Lot's of them.
Starting with the integer 2, I add it to another integer, write the result to disk, and start the process again using the resul... |
null |
null |
null |
First of all, it depends a bit how you can access your data to say which algorithms works best.
Anyway, I would suggest to determine the heights in a top-down fashion rather than bottom-up. I personally think that a top-down approach is conceptually nicer and easier to analyze. For any vertex $v$ in the forest it i... |
A problem so similar it is worth mentioning is *"Parallel Prefix on Rooted Directed Trees."* Here each node ends up with a value that is equal to the number of edges to the root. So the roots ends up with a
the value 0, while e.g. the bottom right node would end up with a value of two.
Note that the algorithm below... |
A problem so similar it might be of interest is *"Parallel Prefix on Rooted Directed Trees."* Here each node ends up with a value that is equal to the number of edges to the root. So the roots ends up with a
the value 0, while e.g. the bottom right node would end up with a value of two.
Note that the algorithm belo... |
A problem so similar it might be of interest is *"Parallel Prefix on Rooted Directed Trees."* The algorithm finds the number of edges to the root from each node. So the roots ends up with a
the value 0, while e.g. the bottom right node would end up with a value of two.
Note that the algorithm below solves the more ... |
I have two strings, where one is a permutation of the other. I was wondering if there is an alternative to [Hamming distance][1] where instead of finding the minimum number of substitutions required, it would find the minimum number of translocations required to go from string a to string b.
My strings are always of... |
Alternative to Hamming distance for permutations |
|terminology| |
|terminology|string-metrics|permutations|edit-distance| |
Finding the minimal distance is called the "Sorting By Translocation" problem. Part of an abstract from a [paper][1]:
"Given two signed multi-chromosomal genomes Pi and Gamma with the same gene set, the problem of sorting by translocations (SBT) is to find a shortest sequence of translocations transforming Pi to Gam... |
null |
null |
I have three different tree traversal of a binary tree Inorder, Preorder and Postorder. I want to identify the tree back from these traversal. I found that a single traversal cant not identify the tree.
So if I'll take in pair then can I identiy the tree? |
How to identify a binary tree uniquely if its Inorder, Preorder and Postorder traversal is given? |
|data-structures|binary-trees| |
null |
Could anybody please make clear what the exact difference of the bound in "branch and bound" and pruning is?
I would be glad if you could give me some references (preferably books), where this difference gets clear. |
What is the exact difference of the bound in branch-and-bound and pruning? |
|algorithms| |
In branch and bound algorithms, you essentially partition the original problem to be solved in a number of subproblems whose union is equivalent to the original problem you started with. The process of deriving new subproblems is called branching and leads to the so-called branch decision tree. Now, when you need to so... |
Could anybody please explain what the difference between "bounding" and "pruning" in branch and bound algorithms is?
I'd also appreciate references (preferably books), where this distinction is made clear. |
What is the difference between bounding and pruning in branch-and-bound algorithms? |
null |
From [Computer Organisation and Architecture][1]:
> The IAS operates by repetitively performing an instruction cycle. Each
> instruction cycle consists of two sub cycles. During a fetch cycle,
> the opcode of the next instruction is loaded into the IR and the
> address portion is loaded into MAR. This instructio... |
Indirection in IAS computer |
|computer-architecture| |
Finding the minimal distance is called the "Sorting By Translocation" problem. Part of an abstract from a [paper][1]:
"Given two signed multi-chromosomal genomes Pi and Gamma with the same gene set, the problem of sorting by translocations (SBT) is to find a shortest sequence of translocations transforming Pi to Gam... |
null |
What is the difference between eScience infrastructures and grid computing or distributed computing infrastructures? And what are some of their examples.
I can not distinguish them clearly. Is it how a grid is used make it an e-science platform? |
What is the difference between E-Science Infrastructures and Distributed Computing Infrastructures? |
|distributed-systems| |
Both eScience infrastructures and grid computing are based on distributed computing, which is related to loosely-coupled applications. There are several models including client-server, peer-to-peer etc. The issues arising in distributed computing, such as security, failures, network partition etc must be taken into acc... |
There are two ways to interpret your dataset generating process. The first produces all even numbers between $2$ and your bound: $2$, $4$, $6$, $8$, \ldots; the second produces all powers of $2$ between $2$ and your bound: $2$, $4$, $8$, $16$, \ldots. An integer $N$ requires roughly $\log_{256} N$ bytes to store. There... |
null |
I am interested in [oriented matroids](http://en.wikipedia.org/wiki/Oriented_matroid) in the context of directed graphs and optimization. Unfortunately, I know very little of the topic. Is there a book, article or a resource that serves as a good introduction to oriented matroids, especially in the context of directed ... |
What is a good resource to learn about oriented matroids in the context of digraphs and optimization? |
|reference-request|optimization|discrete-mathematics| |
[These notes](https://www.fernuni-hagen.de/MATHEMATIK/DMO/pubs/feu-dmo024-10.pdf) written by Winfried Hochstättler for an MAA short course on matroids look like a good, short, introduction. They also contain references to several longer references on oriented matroids. |
null |
Consider a fixed point representation which can be regarded as a degenerate case of a floating number. It is entirely possible to use 2's complement for negative numbers. But why is a sign bit necessary for floating point numbers, shouldn't mantissa bits be using 2's complement? |
Why floating point representation uses a sign bit instead of 2's complement to indicate negative numbers |
|floating-point| |
Consider a fixed point representation which can be regarded as a degenerate case of a floating number. It is entirely possible to use 2's complement for negative numbers. But why is a sign bit necessary for floating point numbers, shouldn't mantissa bits be using 2's complements?
Also why do the exponent bits use a ... |
Why floating point representation uses a sign bit instead of 2's complements to indicate negative numbers |
From Wikipedia:
> The two's-complement system has the advantage that the fundamental arithmetic operations of addition, subtraction, and multiplication are identical to those for unsigned binary numbers...
Two's-complement is a *representation* of negative numbers that just so happens to be very convenient. That'... |
> **Possible Duplicate:**
> [Which combinations of pre-, post- and in-order sequentialisation are unique?](http://cs.stackexchange.com/questions/439/which-combinations-of-pre-post-and-in-order-sequentialisation-are-unique)
<!-- End of automatically inserted text -->
I have three different tree traversal of a bina... |
{"OriginalQuestionIds":[439],"Voters":[{"Id":2205,"DisplayName":"A.Schulz"},{"Id":71,"DisplayName":"Joe"},{"Id":31,"DisplayName":"Dave Clarke"},{"Id":98,"DisplayName":"Raphael"}]} |
null |
Two's complement makes sense when the two entities in question have the same "units" and the same "width". By width I mean that, say, if you're adding an N bit number and an M bit number, where N and M are different, then you better not use two's complement. For floating point numbers, we have the problem of units: if ... |
It is unclear what is being asked here. If the table is of finite and known length, then you can do this using a polynomial regression, although that will not give you an optimal solution. If you simply want to have any arbitrary table turned into an optimal algorithm, then you can use [genetic programming][1] to fin... |
2 problems: Given a known table (boolean or int) convert it to a function that returns the same value using only simple operations (and, or, xor, sum...). For example:
bool table1[] = {0,1} converted to fun(int index){return index;}
bool table2[] = {0,1,1,0} converted to fun(int index){return index ^ (index>>1);}... |
Convert table look-up into function |
|algorithms| |
Theorem 2.29 on page 60 of [Parsing Theory][1] of Sippu and Soisalon-Soininen gives an algorithm for computing (among other operations on relations) the composition of two relations. The algorithm runs in $O(t(|V|+|E|))$ time, where $t$ is the time needed to perform union or assignment operations on sets of vertices. T... |
The problem is in Step 6 (from my understanding - I wish I understood it wrong though - so that it s correct).
Essentially, you idea is to check for sequences {(u,w)(w,v): such that (u,w) \in E(X) and (w,v) \in E(Y)}.
The topological sorting is correct, since in such sequences the two edges must come after each o... |
Definitions: Let $G=(V,E)$ be a DAG without self-loops, and $X \subseteq G$ and $Y \subseteq G$ be graphs.
Input: $X,Y$. Output: The relational composition [relational composition][1] $X \circ Y$ in $\mathcal{O}(|E||V|)$.
- Case 1: $|E| \le |V|$. Two for loops over $E(X)$ and $E(Y)$: Runtime $ \le \mathcal{O}(|E... |
Compute relational composition in $O(|E||V|)$ |
|untagged| |
Let's see:
> Because the target function is approximated locally for each query to
> the system,
If i am going to predict the class (for example) of a brand new instance i compare it with the most similar in the train dataset. Imagine a 2D graphic with lots of points and i put the new point, so i compare with t... |
On the english Wikipedia it says about lazy learning systems:
> Because the target function is approximated locally for each query to the system, lazy learning systems can simultaneously solve multiple problems […]
Source: http://en.wikipedia.org/wiki/Lazy_learning
What does this mean? I can only guess what ... |
How can lazy learning systems simultaneously solve multiple problems? |
|machine-learning| |
null |
It seems that your tables are 1-dimensional. So basically for an integer $x$ you define some value $T[x]$ and you are looking for a function $f$ such that $f(x)=T[x]$.
There is a name for the problem that tries to find a function that runs through a given set of sample points, this is known as **interpolation**. Yo... |
|algorithms|terminology|branch-and-bound| |
|algorithms|optimization|branch-and-bound| |
|computer-architecture|floating-point|number-formats| |
|algorithms|graphs|algorithm-analysis|check-my-algorithm| |
The problem is in Step 6 (from my understanding).
Essentially, you idea is to check for sequences $(u,w)(w,v)$ whether $(u,w) \in E(X)$ and $(w,v) \in E(Y)$.
The topological sorting is correct, since in such sequences the two edges must come after each other.
An edge $(u,w)$ is black if it belongs to $E(X)$. ... |
On the english Wikipedia [it says about lazy learning systems](http://en.wikipedia.org/wiki/Lazy_learning):
> Because the target function is approximated locally for each query to the system, lazy learning systems can simultaneously solve multiple problems […]
What does this mean? I can only guess what "approxima... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.