instruction stringlengths 35 29.1k |
|---|
Say, I have a file that is somewhere between 10-20 pages long. I need to extract 10-20 pieces of information from it that I can fairly easily extract using a series of regex-es or by running code that reads things line by line and extract information that way. Is there a way that is necessarily faster than the other?
... |
I have the following repetition structure:
sum = 0
for (i = 0; i < n; i++) {
for (j = 0; j < i*i; j++) {
for (k = 0; k < j; k++) {
sum++
}
}
}
By the following, I have reasoned the runtime of this structure to be in $O(n^7)$ :
$\sum_{i=1}^{n} (\sum_{j=1}^{i^2}(\sum_{k=1}^{j} k))$
$= \sum_{i=... |
Starting with two examples:
for(i = 1; i<10; i++) {B[i] = 0;}
for(i = 1; i<10; i++) {B[2i] = 0;}
In the first example, the successive accesses to the array are in contiguous locations whereas in the second example they are at alternating locations. Therefore, the total access time is lesser in the first case.
Now,... |
Suppose that we have an $m\times n$ matrix $A$ of rank $n$, whose entries are 8-bit unsigned integers obtained from a grayscale image. Now we want to apply SVD to $A$ and to use the first $k$ singular values to construct the the best rank-$k$ approximation of $A$ to accomplish compression for data storage.
I understan... |
I want design algorithm that allows a student to take important courses quickly up until graduation. no time, room number, professors needed here. just my selected courses I know will allow me to graduate but how best to take them based on prerequisites. the student can decide how many courses to take a semester. And,... |
I'm trying to classify and come up with a reasonable solution for the following problem (abstracted from a real world problem).
Problem
Imagine StackOverflow started offering a subscription where companies could buy X number of impressions per month for a set of tags.
For example, you might be interested in running a... |
I was wondering why do we need to do the topological sort before performing relaxing of edges.
Wouldn't it'd be better if we do :
if starting vertex is "s"
queue.add(s)
while(the queue is not empty)
for every adjacent vertex v of u
if( dist[v] > dist[u] + weight(u,v) )
dist[v] = dist[u] + weight(u,v)
... |
In pseudo direct addressing mode (For the MIPS architecture) the 26 bit of the jump instruction are joined to the upper 4 bits of the PC .
how could this help in jumping to relative positions suppose I want to jump backward instead of forward ( i.e. if i want to jump to the beginning of a loop after executing it's bod... |
I am seeing two definitions of strongly NP-hard that seem to be slightly different:
A problem is strongly NP-hard if a strongly NP-complete problem has a polynomial time reduction to it.
A problem is strongly NP-hard if it is still NP-hard when all numbers in the input are bounded by a polynomial in the length of the ... |
Consider the decision problem that when given a graph, we need to decide if a particular edge belongs to any optimal solution to the traveling salesman problem on that graph.
It may be argued that the complexity of this problem is strictly greater than any co-NP problem. The idea is that it's perhaps impossible to come... |
I'm struggling to find the context-free grammar for the following language:
$$
L = \{a^sb^tc^m:s,t,m\in\mathbb{N}^+\land1\leq t\leq3\land s\times t=m\}
$$
Any help would be appreciated.
|
I've read that Luk-Vuillemin multipliers are similar to Wallace multipliers but partition their inputs in a different way. How exactly does this partitioning work, how does it change the structure of the multiplier, and why does it give it a more regular structure which is preferred for fabrication?
|
A set of English words is given.
Is there linear or sublinear algorithm to build minimal DFA for the given dictionary?
I tried different approaches, and they all were concerned with building Trie and then minimizing such automata.
So it is very interesting for me is there some algo using it to solve my problem.
P. S. T... |
This is probably a very basic question but one that I am having trouble finding a definitive answer for since this kind of thing is skimmed over in most introductory algorithms courses. Take an algorithm like DFS that runs in time polynomial in the number of inputs. In this case your input is a graph with $n$ vertices ... |
All of us have saved a file on our computers using a programming language. If I look down through the layers of abstraction, I usually get stuck at a kernel-level call or a C-call like fwrite(); But even at this already deep level things like filesystems and location of storage are hidden from us. For example, one cann... |
Imagine the game handled server sided, don't think of a visual problem.
Given a game 2D map, with size of n * n.
The game contains objects (such as door, wall, a table).
Each tile position (x,y) can contain multiple objects, but this is not the catch of the question, it can even be limited to one.
The data structure fo... |
I have a collection of $n$ vectors $x_1, ..., x_n \in \mathbb{R}_{\geq 0}^{d}$. Given these vectors and an integer $k$, I want to find the subset of $k$ vectors whose sum is shortest with respect to the uniform norm. That is, find the (possibly not unique) set $W^* \subset \{x_1, ..., x_n\}$ such that $\left| W^* \righ... |
Using Church's $\lambda x.(\lambda y.y))$ as false and $\lambda x.(\lambda y.x))$ as true, and given two free variables $g$ and $h$:
Could there exist a function $eq?$ such that $(eq?\ g\ h)$ is false, and $(eq?\ g\ g)$ is true?
I typically would show my work here, but as of right now, I honestly have nothing except a ... |
I'm struggling to find the language generated by the following grammar:
Any help would be appreciated.
|
Setup
Here’s the setup: I have an $N$ x $N$ grid of tiles, and a list of $M$ agents that need to move across the grid. Each agent has its own start tile $S(a)$, end tile $E(a)$, and an exact number of steps $D(a)$ it must make. Each step consists of a one-tile move horizontally, vertically, or staying in place. For e... |
What is the complexity class of an algorithm that runs in $n^{\mathcal{O}(\sqrt{n}log(n))}$ time?
As $n$ gets large $\sqrt{n}log(n)$ increases at a very slow rate. Does this mean that the algorithm has the same complexity as $n^{\mathcal{O}(1)}$, which would be in $P$?
|
This question is strictly about terminology.
I'm not an expert in CS, but I've almost always seen the word "efficient" applied to an algorithm to mean "of polynomial runtime". E.g. this question and the Wikipedia article on computational complexity theory use the word in that way.
However, other sources (e.g. the Wikip... |
I know that the height of a red-black tree is at most 2 lg(n + 1). However, what is the mathematical proof of this? I searched various sites, however I couldn't find a good proof. I already know the properties of a red-black tree.
|
For this question, I thought function F called twice but it called three times. Are those three functions were called? F(N), F(K) and F(N-1)?
How many times in this pseudo-code is the function F called?
Main
Declare K as Integer
K = 3
Set Result = F(K)
Write Result
End Program
Function F(N) as Integer... |
Given $L$ is a regular language, how can I prove that $L^*$ is a regular language too?
I've constructed an NFA which contains a new initial state that has an $\epsilon$-transition to the original initial state, and also connected all the final states to the original initial state with an $\epsilon$-transition.
How can ... |
I've been searching in the literature for examples of distances defined on the set of the DFAs (or on the set of minimal DFAs) that are defined on a given alphabet sigma.
Since the languages they describe (regular languages) can potentially have an infinite size, defining a distance is not a trivial matter.
Neverthel... |
In an explicit algorithm I'm writing, there is a certain stage where I need to determine whether or not a certain noisy univariate data is constant or is sum of step functions.
For example, defining foo as the algorithm I'm after (writing in Python):
assert foo([0]*20) == False
assert foo([0]*20 + [1]*20) == True
asser... |
I mean I could just start putting values in each function and arrange them according to their corresponding values. But is there a better way of doing this.
|
I was attempting, though failing quite miserably, to find some method of of determining the range of some node $n$. By range I mean an interval $[l,r]$ over the base array that is reachable by the sub-tree rooted at $n$.
I'm sorry of using incorrect terminology; I am inexperienced in formality. If, due to this, my expl... |
I have an input x (a word), and I have a neural network Y such that Y(x), which is an image always satisfies F(x), and another neural network Z such that Z(x), which is also an image, always satisfies G(x). Is there any way to turn this into a neural network Q where Q(x), which is also a image, satisfies "F(x) ∧ G(x)"... |
Can all types of computational problems (search, counting, optimization...) be modeled as (sets of) decision problems? Rephrased: For every type of computational problem is there a set of decision problems that if you solve those problems you get the result of the original problem?
colloquially: can all types of questi... |
In the definition of a complexity class like P, where they reference Deterministic Turing machines (DTMs), I don't see any restriction on # of tapes these DTMs are allowed to use.
If a language L is in P do all its words have to be decidable in polynomial time by a 1-tape, 2-tape,....k-tape Turing machine in polynomia... |
If we have a set of points $A$ and a known algorithm $Bestfit(A)$ to find
the best-fit straight line-segment through $A$, what would be a good algorithm to construct piece-wise linear segments (with at most $k$ segments) to give a better approximate of the set of points and reduce the error $E$?
|
Thoughts
I am wondering if you get a string that goes through the NPDA and arrives back at q0 can I go through the NPDA again so that the last number in the string is not fixed, or is it that once I am back in q0 and the $ is removed from the stack I stop
|
The complexity class PP is not considered tractable, because the probability of success can get arbitrarily close to 50% from above as the problem instances get larger, so that (e.g. if this approach is exponentially fast) an infeasible number of repetitions may be required before we have a significant probability of c... |
I came across a problem that I have no clue how to solve.
Consider two Monte Carlo algorithms, called A and B that both solve the same problem.
A is true-biased and t-correct, while B is false-biased and z-correct.
Show that you can combine both A and B to obtain a Las Vegas algorithm to solve the same problem.
Also, ... |
Say I have a large area filled using floodfill:
Where the area in white has been flooded, and all other ares are not connected. I would like to "bridge" these islands to the main area in white, but I'm not sure of the best algorithm to use that would do this most efficiently.
My current method is to find the nearest n... |
The Urgent Flag(URG) is set whenever the sender's Application Layer wants to send some urgent data to the receiver. In this case, the Transport Layer does not wait for enough data to achieve maximum segment size. Now, my question is how do the routers in between recognize that the packet needs to be forwarded urgently(... |
I think PRIME (is the given number a prime number?) is a good example a decision problem. Therefore, when I'm trying to explain reduction, I'd like to give an example of a problem that is related to PRIME.
What are decision problems that can be reduced to PRIME, and how do these reductions look like?
What are decision... |
Am I right in my understanding for amortized time for insertion in a dynamic array list? (dynamic means create a copy double its size and copy existing elements to new one WHEN we reach the current size limit). Please validate my explanation/understanding.
If we insert X elements into an array of initial size 0, it wil... |
Say I have a set of schools coordinates (S). I also have a set of neighborhoods centroid coordinates (N).
I know how many kids are in each neighborhood, and they are categorized as either primary, middle or high school. So, in other words,
N = [(locationN1, primary:3, middle:10, high:4), (locationN2, primary:10, middle... |
I know this is a common algorithm with plenty of analysis, but when I searched for an answer the only one I found was "Merge Sorting has O(n) auxiliary space because it copies the array into L and R".
I don't understand this because as it is called recursively, before performing any operations, the entire array is sti... |
The original problem is given a large input file, with n input lines of random string, find the number of pairs-> meaning same number and type of characters, in the file. Constraint on type of characters is: any legal ascii(0-127) char besides 10 and 13. I am trying to implement a hashCode function for a wrapper class ... |
In 'The Computer Organization and design book' it illustrates the call instruction as
Decrementing the stack pointer by 4.
saving the EIP+5 into the stack.
Jumps to the new address specified.
What I know already is the instructions in this architecture are not typically all 4 byte in length, Hence.
How do we standar... |
I'm a bit tripped up by this fundamental notion of an equational theory with respect to how we can possibly get termination if we have that we can always orient a set of equations either right to left or left to right. For example, consider the set of equations just being $E=\{1+x=x\}$. For signature $\Sigma$ we consid... |
Sipser in his book introduction to the theory of computation provided a proof of undecidability of $HALT_{TM}$. He uses a contradiction, he assumed that $HALT_{TM}$ is decidable, and built a decider for $A_{TM}$, and since $A_{TM}$ is already proved by digonalization method to be undecidable, thus the contradiction occ... |
After defining pushdown automaton in Sipser's book at p. 113:
at the bottom of p.114, he tries to describe a way to make a diagram for pushdown automaton as following:
My question is about the part "If $a$ is $\epsilon$, the machine may make this transition
without reading any symbol from the input." But in many exam... |
The question is quite straightforward: Why do Karnaugh maps work? What was the reasoning that led Maurice Karnaugh to come up with these maps? At first glance, it doesn't seem a natural approach, instead it feels somewhat arbitrary yet surprising that it works.
|
This is a real-world application, not a student assignment.
Suppose we have some numbered boxes which are to be laid out, in order, from left to right, top to bottom, with no space between them, into a column of fixed width and infinite height.
The boxes have the same height, but variable width.
When a box doesn't f... |
I was reading this article about propositional logic and transforming problems to SAT. The author often uses the following notation (taken from Dominating set section):
I don't understand what $[v,i]$ and $[w,i]$ stand for in $at\_most\_one$ and $at\_least\_one$ parts. I checked the paper twice and didn't find the par... |
Consider the next problem:
$k$-COL: Given a graph $G=(V,E)$, does it have a valid $k$-coloring?
I need to prove that if $k$-COL is in BPP, then it is also in ZPP. In other words, show that if there is a probabilistic polytime algorithm that decides whether a graph has a valid $k$-coloring or not with bounded error, th... |
I'm struggling to understand why there is such a radical difference in the execution time and number of steps required by two seemingly similar algorithms for Breadth-First Search in a 2d grid.
In the Python program below, uncommenting the indicated lines switches between versions.
As well as help with understanding th... |
there are many similar questions, but I haven't found direct answer to this question. Consider I have undirected, weighted graph with positive weights, no additional data - hence no heuristic (so it is not possible to use A*), is Dijkstra's algorithm with Fibonacci queue fastest known algorithm in terms of big-O notati... |
Consider a binary (i.e. over $\{0, 1\}$) matrix $A = (a_{ij})$ of size $n \times n$. It is known that there is exactly one $r \in [1; n]$ such that $a_{rj} = 0$ for all $j \in [1; n]$ and $a_{ir} = 1$ for all $i \in [1; n] \setminus \{r\}$. How to find $r$ asymptotically in $O(n)$ in terms of time?
|
I have been stuck on this problem for a while now; any help would be appreciated.
Given a string S, find the number of distinct substrings which are composed of 2 or more consecutive strings. For example, "abbccbbadad" has 3 because "bb" is composed of 2 "b"s, "cc" is composed of 3 "c"s, and "adad" is composed of 2 "ad... |
Is there an algorithm to optimally space points within multiple intervals? Optimal in this case means maximizing the smallest distance between any two points so that each pair of points has at least distance X. For example, in the intervals (1,3) and (5,7) you can space out three points with a distance of at least 2 (a... |
Suppose I have only three independent features (x, y, z) as the input to some machine learning routine (e.g. neural network). From some domain knowledge, I know that the output o(x, y, z) must have the specific functional form
o(x, y, z) = f(x)*g(y)*g(z)
where the g(.) are the same function. The details of f(.) and g(.... |
I am working with some research problem connected loosely to TSP which requires to find the Minimum Spanning Tree of a fully connected, weighted graph, where all the weights are positive and the graph is undirected (just like in Christofides algorithm). The point is, the problem I am working on requires me to find the ... |
Does saying $f(x) = \Theta(1)$ provide any extra information over saying $f(x) = O(1)$?
Intuitively, nothing grows more slowly than a constant, so there should be no extra information in specifying Big Theta over Big O in this case.
|
Consider an ODE $\dot y = f(t, y)$. We will approximate the value of $y$ using the 4th-Order Runge-Kutta method. Let $\Delta$ be the step size, then in step $i+1$ we have $~y_{i+1} = y_i + deriv\cdot\Delta~$, where:
\begin{eqnarray*}
deriv &=& \frac{1}{6}(d_1 + 2d_2 +2d_3 + d_4) \\
d_1 &=& f(t_i, y_i) \\
d_2 ... |
In CLRS, an approach has been given to prove the optimal substructure and the correctness of the greedy algorithm for the activity selection problem. In the Lecture Hall assignment problem, we sort the classes according to their starting times and assign them lecture halls accordingly, choosing a new lecture hall if th... |
A deque is implemented with 3 stacks. one for the head, one for the tail and one is always empty.
Pushing is therefor O(1), light popping (in case the head/tail respectively aren't empty) is also O(1).
A 'heavy pop' is in a scenario when we have k elements, only in 1 stack and we wish to pop the other stack.
For exampl... |
I am studying algorithms and datastructures, and in CLRS chapter 33.4, the exercise 33.4-4 states the following:
We can define the distance between two points in ways other than euclidean. In the plan, the $L_m$ distance between points $p_1$ and $p_2$ are given by the expression $(|x_1-x_2|^m+|y_1-y_2|^m)^{1/m}$. eucli... |
If $L$ is not regular and $ L \subset L_1$, does it follow that $L_1$ is not regular also? Can you please provide an explanation? Thanks in advance.
|
Given $n$ types of items with integer cost $c_{i}$ (there is an unlimited number of items of each type), such that $c_{i} \leq c$ for all $i = 1, 2, \dots, n$, answer (a lot of) queries of form "is there some set of items of total weight $w$?" in time $O(1)$ with some kind of precalculation in time $O(n c \log c)$.
I'v... |
Consider the standard version of Dijkstra's algorithm on directed graphs. Assume it is known that the input digraph $G = (V, E)$ has the following property: for all $v \in V$ the weight of all outgoing edges $vu$ is the same.
How can one modify Dijkstra's algorithm so that exactly one relaxation is done for every vert... |
The transitive reduction of a (finite) directed graph is a graph with the same vertex set and reachability relation and a minimum number of edges. However, what if vertex additions are allowed? In some cases, the addition of vertices can considerably reduce the number of edges required. For example, a complete bipartit... |
I came across this question about NFA-e and thought to convert it into DFA:
This is what I did.
$\begin{array}{|c|c|}
\hline
& a \\ \hline
q_1&q_2 \\ \hline
q_2&\phi \\ \hline
q_3&\phi \\ \hline
\end{array}$
Found epsilon closure of states:
$\varepsilon(q_1) = q_1$
$\varepsilon(q_2) = [q_2, q_3, q_1] = P$ (let)
$\v... |
I have stumbled about the way a text file is saved by the OS.
I have typed:
printf "ab" | hexdump
and the output was:
6261
which are the letters in reversed order. My first intent was endianess, but this cannot be true, since at this level, such abstractions must be transparent to the programmer and user. Also endia... |
I am studying AES and trying to implement it. But I am having difficulty understanding the Mixing Column step. In that step we have to perform matrix multiplication between the state matrix and another fixed matrix. Here is the example given in the material I am studying from:
I am not getting the 03*2F part. How did ... |
This is self study, but not homework. I am reviewing some slides I found online and have come across the following question.
Question:
If the latency of integer multiply is $3$ and the cycles/issue is $1$ then
How fast can 10 independent int mults be executed?
$$t_1 = a_1*b_1 \quad t_2 = a_2*b_2 \quad t_3 = a_3*b_3 \... |
Suppose I have $n$ courses, some with some prerequisites, and I can take up to $k$ courses in a semester. I want to compute the least number of semesters needed to complete all courses, while respecting prerequisites.
Equivalently: suppose I have a dag $G=(V,E)$, and a positive integer $k$. The desired output is a se... |
The master theorem can be used in case of a recurrence relation of the form
1) $T(n) = aT(\frac{n}{b}) + f(n)$
My question is whether it can be applied if
2) $\frac{T(n)}{g(n)} = aT(\frac{n}{b}) + f(n)$.
My gut feeling is that is should be possible: just solve equation 2 by solving equation 1, and then multiply the as... |
We have a set of $n$ double wedges on a plane. (By double wedge, I mean two lines intersecting at a point, with opposite sides of the point considered as "inside" the double wedge.) Now these $n$ double wedges can intersect each other.
Our query is as follows: given a point, we want to find how many double wedges it's ... |
I am trying to sort Grammar into the Chomsky Hierarchy and I can do so for most of my examples but I am stumped by the following one:
bX -> abY
which Type of Grammar would this be, unrestricted grammar, context-sensitive grammar context-free grammar or regular grammar
Thank you for your help
|
Given the 2D grid shown below, where blue tiles can be visited and island tiles cannot.
Given that we do not know the starting position of a player on this grid.
Given that the player can move 1 step in any cardinal direction every turn.
Given that the player cannot visit tiles he has already visited.
Given that we are... |
A) Let $L$ be a regular language. according to the theorem there is an DFA which accepts the language.
Describe shortly how to change the DFA to NFA which Accepts $L^R$, where R is reverse.
There is no need to write how to build formally or proof or correctness.
B) True or False: if $L$ is not regular then $L^R$ is not... |
The form of the Time Hierarchy Theorem that I have is this:
If $f$ is time constructible then $\text{DTIME}(f(n)) \subsetneq \text{DTIME}(f(2n+1)^3)$.
We want the consequences of this to be that $\text{P} \neq \text{EXP}$ and $\text{EXP} \neq \text{2-EXP}$ etc. But I can't see how this follows.
I have $\text{P}$ defi... |
What does it mean by "orthogonality" in the context of Instruction Encoding?
Why CISC Architecture is orthogonal while RISC is not?
|
Consider the following recursive fast Fourier transform algorithm from CLRS:
I believe that I understand this algorithm correctly: you split the input coefficients into the odd and even terms, recurse, and combine using the roots of unity.
However, I am aware that you can also use this recursive fast Fourier transform... |
Given that we have 2 people, and 2n tasks, find the minimum time to complete the tasks. Both persons should solve exactly n tasks each and any task j has to be solved before task j+1. Required time complexity is O(nlogn).
E.g- given this input:
A B
5 3
2 1
3 2
1 2
the intended output is 8, because A solves the second ... |
Given a set of 2d trajectories/paths, where a trajectory is a list of [x,y,time] coordinates, and a new trajectory, how can I recognize which one in the set is most similar to it? The lists may not be of the same length, the time differences not the same.
I've tried using perceptual image hashes of the resulting lines,... |
I'm preparing for an exam and trying to make some sense of the growth of the different exponential functions. I picked the trickiest functions for myself and tried to sort them according to the big O notation. Since it's hard to use L' Hospital's rule on exponential functions I at least want to get a feeling for the or... |
Let's assume I have the following code:
declaration of a
declaration of b
..a..b
{
..a..b
declaration of a
declaration of b
..a
}
In this code {} represent the inner block. declaration represents binding occurrence, and .. represent applied occurrence.
So my question is that is it legal to use the outer scope... |
for (int i = 1; i <= N; i++)
for (int j = i; j <= N; j+=i)
for(int k = j; k <= N; k+=j)
How to express this mathematically to calculate the complexity of the above code. I guess, its complexity is $O(N\log\log N)$ but couldn't prove it mathematically!
|
My objective is to shift rows by x and columns by y in a 2d matrix. My problem is to solve this objective in an efficient manner.
x and y could be negative or positive. Negative would mean up/left and positive would mean down/right.
My current solution is something like this:
def rotate_columns(col, y):
new_col_pos... |
I've encountered some problem which seems general enough to have already been solved.
There is a set of objects $O=\{o_1, o_2,\dots,o_k\}$ and a family of sets $A_1,A_2,\dots,A_t \subseteq O$.
For every $1 \leq j < k$ we need to find a subset $O' \subset O$ of size $j$ maximizing the number of sets $A_i$ contained in i... |
I have a set of several thousand strings of max length 1024 (containing all visible ASCII chars plus space) I need to store to make it fast to search for an exact match of a key. What is the best algorithm to store the set and to search for a match?
|
Let G be a tree-structured graph. A connected induced subgraph is an induced subgraph from G that is connected. (Since the original graph is a tree, any connected induced subgraph is also a tree)
My question: Given a tree G of n vertices, how many connected induced subgraph can be obtained from G?
An example: n = 4, G ... |
I'm getting a bit confused about the three terms and their differences: Depth-First-Search (DFS), Backtracking, and Branch-and-Bound.
What confuses me:
Stack Overflow: Difference between 'backtracking' and 'branch and bound', Abhishek Dey: "Backtracking is [always] used to find all possible solutions" and "[Branch and... |
I'm attempting to do a hobby automation project and have come to a roadblock. I have a certain problem I need to solve, but can't think of the solution nor what the name for the problem would be.
Say we have n tasks where each task requires $x_i$ amount of work to be done and m resources where each resource can provid... |
I'm reading Microsoft's white paper "Round-Based Public Transit Routing" (the RAPTOR algorithm). What are the ways to find next best paths (path is a sequence of trips and transfers from source to destination)?
I have few ideas about it:
Find best path, then exclude trips (from path) from transportation network
and re... |
Exactly 1 in 3 SAT ($X3SAT$) is a variation of the Boolean Satisfiabilty problem. Given an instance of clauses where each clause has three literals, is there a set of literals such that each clause contains exactly one literal from the set. $X3SAT$ is NP-Complete even when the instance is monotone and linear. Monotone ... |
An assignment question asks,
Given a connected, undirected graph $G$, describe an algorithm which can determine if the removal of any pair of vertices would cause $G$ to become disconnected.
There is an obvious brute force solution, which is to just generate all pairs of vertices, produce new graphs with those vertic... |
While implementing a debugger I've encountered a problem I need to solve concerning dependency graphs. I've simplified it as follows:
Consider a strongly connected graph G = (V,E).
We define a subset of vertices S ⊆ V as source vertices.
We call an edge e = (a,b) unfounded if there is no simple path from any source ve... |
I'm attempting the problem of finding the median element in two AVL BST's in $O(\log n)$ time. In this problem, we are given two AVLs, with a combined size of $n$ (the distribution across the two trees need not be balanced – it could be that one AVL contains $n-1$ elements, and the other $1$), and the goal is to find t... |
Suppose we have a model of computation $C$ we want to show to be Turing complete. The usual strategy would be to emulate within $C$ any model of computation we already know to be Turing complete (e.g. an arbitrary Turing machine). On the other hand, a model of computation is Turing complete if and only if it can comput... |
Can you recommend an algorithm for the following problem? If you have any suggestion for simplifying the problem I am open to it.
There is a number line going from $0$ to $x$. There are $r$ rewards and $o$ obstacles placed on the line. Items can only be placed on whole numbers. There is an animal at point 0 which can j... |
If $A$ is an infinite regular language, can there exist a finite regular language $B$ such that $A = BB^*$?
|
So I make a research on my own. I have a device it allows a 64bit message. I wanted to secure it but I 64bits arent just enough to hash it and encrypt it. Is there really any good Hash function out there that can produce a 64bit result from a seed of 128bit ? I tried to search but there are many limitations.
Note I use... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.