instruction stringlengths 35 29.1k |
|---|
I want to flatten a binary tree into a linear array, and I wonder if there are specific algorithms to improve locality in the linearized representation (for instance, ensuring that all data from the left child of the root node appears before the data from the right child is an easy optimization.) What is the recommende... |
Consider the non-deterministic finite automaton A: (in below figure)
1> convert this NFA to DFA
2> Find if there are equivalent states of your DFA
3> Minimize the DFA of <2> if possible
This is what i have got so far
4> further question: Prove that the DFA in <3> recogniese the intended language L.
I got stuck on th... |
I've got this problem:
Write down a definition of P-completeness analogous to the definition of
NP-completeness, i.e., using polynomial-time reductions.
Which problems are P-complete in this sense, and why?
Thus, what is the problem, i.e., what must be changed if the goal is to come
up with a more interesting not... |
A badly explained textbook example asks the following:
Suppose we have a definition of the dictionary our database will use (that is, it's relations and constants), defined as:
$<R_\le (?, ?), R_+(?,?,?), R_*(?, ?, ?), c_0, c_1>$
where $R_{operation}$ defines the nature of the relationship of the values inside (represe... |
This is an exercise in the book Introduction to Algorithm, 3rd Edition.
The original question is:
Show how to implement GREEDY-SET-COVER in such a way that it runs in time $O(\sum_{S\in\mathcal{F}}|S|)$.
The GREEDY-SET-COVER in the text book is as follows:
Definition for $(X,\mathcal{F})$ is given as:
|
In the text book, Introduction to Algorithm, 3rd Edition.
In the chapter, Approximation Algorithms and for the problem Travelling Salesman Problem, the author says:
I am wondering how triangle inequality gives rise to this assertion? It seems that this property is not that important, as I searched through the rest of... |
In the chapter, Approximation Algorithms of Introduction to Algorithm, 3rd Edition, for the approximation problem Travelling Salesman Problem, the author proposes a approximation method that first constructs a minimum spanning tree.
In order to prove this algorithm is a 2-approximation algorithm, the author claims tha... |
While studying for a test in my OOP course, I came upon this question which had an answer I didn't really understand. The question is as follows (translated):
The programming language "Sava" is similar to Java in every way except in the following:
It's structurally typed
When overriding a method the argument can be c... |
I use Mathematica to solve problems. I have a question about matrix inverse.
if I want only one element of the inverse matrix, does there exist a faster algorithm than using Inverse to calculate the whole inverse matrix and extract the element which I want?
|
Both wikipedia and my lecturer explained how the 2 satisfiability problem work. However, I am finding it really hard understanding how this formula:
xvy≡ ¬x-->y ≡ ¬y -->x
Then breaks down the following conjectures :
(¬x v y) & (¬y v z) & (¬z v w) & (¬w v ¬x) &
(x v ¬y) & (y v ¬z) & (z v ¬w) & (w v x)
is converted to... |
I was wondering how to remove duplicate values from a linked list in $\mathcal{O}(n\lg n)$ time. I have an idea that by using merge sort when we want to compare elements for choosing the small one, if they are equal advance on pointer and just consider one element. Any alternatives?
|
Background
A proof-of-work system allows one peer to prove to another peer that a certain amount of computational effort was performed.
In a network setting this can be used to throttle peer requests without needing to keep a precise track on the identity of the peers or prior events.
The most well known use of proof-... |
What are the reasons for decreasing the number of threads in a parallel implementation ?
Assume that we have two implementations, the first one with 4 threads, and a second one with 8 threads, and both have exactly the same run time. What are the various reasons to prefer the first one?
I stress on the fact that the t... |
I have an option to learn a new language for parallel computing. As a parallel programmer what are the reasons one might want to invest time to learn functional programming for parallel computing?
|
There is one point I don't understand in the DFA construction for mismatch cases.
Here is the lecture note I watched, which describes how to handle mismatched characters during the DFA construction process.
Some information about the presentation screen shot:
pat is the pattern, string index starts at 0, dfa is the st... |
What is the meaning of the double, down facing arrow $\Downarrow$ in the context of operational semantics? Here's the example formula that uses it:
$$\frac{s_0 \vdash M_1 \Downarrow P_1, s_1 \; ... \; s_{n-1} \vdash M_n \Downarrow P_n, s_n}{s_0 \vdash M \Downarrow P, s_n}$$
It would be also beyond priceless if you coul... |
I was given a quick lesson on Turing Machines which I found interesting. However, I came up with a problem which made me think a bit on a problem and since it's not an actual class, the answer was not given. First, let me give you some background info on a Turing Machine:
A Turing machine is a quadruple (K, sigma, smal... |
I want to know why error control is used in transport layer although it is used in data link layer?While data link layer has all data came from upper layers in its frames so its error control should be sufficient.
|
Let $O(n)$ be "Big-O" of $n$ and $o(n)$ be "Small-O" of $n$.
It is a well-known fact that $O(n \log{n}) \subset O(n^{1 + \epsilon})$ for any $\epsilon > 0$. Can we omit the $\epsilon$, and just type $O(n \log{n}) \subset O(n^{1 + o(1)})$?
|
I've been learning about neural networks and SVMs. The tutorials I've read have emphasized how important kernelization is, for SVMs. Without a kernel function, SVMs are just a linear classifier. With kernelization, SVMs can also incorporate non-linear features, which makes them a more powerful classifier.
It looks t... |
Problem Statement:
Suppose we have a thousands of words and we need to maintain these words in a data structure in such a way that we should be able to find all anagrams for a given string.
I tried to achieve this with O(1) complexity.
I am looking for a algorithm to implement above scenario. I implemented this problem... |
I wanted to know the pros and cons of Chomsky normal form and Greibach normal form.
|
For labelled trees there are the Pruefer numbers that uniquely identify them. Is there a similar numbering system for unlabelled trees?
|
How to minimize the sum of difference of element in sub-sequence of array of length k from given sequence of length n ?
for example : for n=10
1
2
3
4
10
20
30
40
100
200
the sub-sequence of length will with minimized sum of difference will be
1 2 3 4
as |1-2| + |1-3| + |1-4| + |2-3| + |2-4| + |3-4| = 10 i.e minimum i... |
I want to know which algorithm is fastest for multiplication of two n-digit numbers?
Space complexity can be relaxed here!
|
I'm writing a paper on the topic of applications affected more by memory performance than processor performance. I've got a lot written regarding the gap between the two, however I can't seem to find anything about the applications that might benefit more from memory performance.
I suppose these are applications that m... |
While Learning about removing null moves from NFA , I came across a thought....
To Remove Epsilon moves we follow following steps :
Find Closure of all states which have null moves
Mark these states which have null moves
Make a revised transition table without epsilon column and Find all possible transition for those ... |
Given a procedure/function
$Select(S,r)$ - which selects element of rank r from set S
which uses at most $|S|. constant$ comparisons
We design another function $Multiselect(S,R)$
with $R =\{r_1<r_2<...<r_k\}$
returns $X =\{x_1<x_2<...<x_k\}$ such that rank of $x_i$ is $r_i$
What is the minimum no of comparisons for t... |
http://courses.csail.mit.edu/6.046/spring04/handouts/prac-quiz2-sol.pdf
I'm confused as to the solution for the snowball question. To start with, I have two specific questions:
(1) Each pair $a_i,b_j$ will account for one term (and why ONE term)? What is meant by term here? The coefficient, $c_k$ of the polynomial C? O... |
In my world there are nodes and lines, I want to see if there is any path between node A, and node B, that do not cross any line(including the lines of the path itself) and do not go thru the same node twice. What would be the efficiency of such algorithm and where can I find more information about it.
So far I been re... |
I'm a computer science student. I want to create my own programming language (A basic language with few instructions).
I know how to do a syntactic analyser, I already did it in Perl. In an article, I read something about the compiler, a compiler is done in itself.
For example the C compiler is written in C. How it's p... |
I have been reading a paper Finding Maximal Pairs with Bounded Gap:
An in there, there is a sentence (page 6 second paragraph):
The “smaller-half trick” is used in several methods for finding tandem repeats,
e.g. [2, 5, 26]. It says that the sum over all nodes v in an arbitrary binary tree of size n of terms that ar... |
I need to prove that $n^4+2n = \Omega (n^2)$
Which means I need to point two constants $c_1,c_2$ that from $n_0$:
$$ c_1 \leq \frac{\log(n^4+2n)}{\log(n^2)} \leq c_2$$
Now I know that:
$\lim_{n \to \infty } \frac{\log(n^4+2n)}{\log(n^2)} = 2$ so I can choose $c_1 = 0.5$ and $c_2 = 3$ but how do I do I calculate the $n_... |
How do we prove $M$ that is a deterministic random access machine that decides a problem $A$ for an input $i$, and $u_M(i)$ is the set of addresses of those registers that occur at least once with $s$ steps and a configuration of $C_0,\dots,C_s$ where each configuration is of the form $C_i=(k_i,R_i)$, were $k_i$ is the... |
This is the problem, given a string with characters from: a-z, ., *, and another string with characters from a-z. where * can delete the character before it, otherwise * is skipped and . can match any single character. the question is whether the first string can match the second one.
Note: That is the statement of the... |
Let $PAL = \{ww^R\ | w\in\{0,1\}^*\}$.
Then let $A = \{\langle M\rangle \ | \textit{M is a Turing Machine and } L(M)\subseteq PAL\}$
Is A semi-decidable (Turing recognizable or recursively enumerable)?
My try!
I said it is so here is my proof, tell me if I am way off base or tell me if A ought not to semi-decidable in... |
Say you have two polynomials: $3 + x$ and $2x^2 + 2$.
I'm trying to understand how FFT helps us multiply these two polynomials. However, I can't find any worked out examples. Can someone show me how FFT algorithm would multiply these two polynomials. (Note: there is nothing special about these polynomials, but I wanted... |
What algorithm would you use to find the shortest path of a graph, which is embedded in an euclidean plane, such that the path should not contain any self-intersections (in the embedding)?
For example, in the graph below, you want to go from $(0,0) \rightarrow (-3,2)$. Normally, an algorithm like Dijkstra's algorithm w... |
I have this question I'm struggling with.
Let $A=\{<i,n>|\;n \in \phi ^{(i)}\}$. In other words, $A$ is the language defined by the set of all pairs $<i,n>$ such that $n$ is $\leq_m$ to the $i$th Turing jump.
A is definitely not an arithmetically definable language, and you can prove this by contradiction.
I have to ... |
Given a euclidean graph $G$ and a node $p$ with edges to all the other nodes, is there a more efficient solution than $O(NLog(N))$ to output all the edges to $p$ in sorted order?
|
Let $\Sigma$ be the alphabet $\{a, b, c, d\}$ and let $R$ be the following relation on $\Sigma^*$: $R(x, y)$ is true if every letter in string $x$ also occurs in $y$, and every letter in string $y$ also occurs in $x$. (For example, $R(abba, babbb)$ is true and $R(abcb, cbbcb)$ is false.) How many (non-empty) sets are... |
Let $L$ be the language $\{w \mid w \text{ has equal numbers of \(a\)'s, \(b\)'s and \(c\)'s}\}$. Prove that its complement $\overline{L}$ is context free.
|
How can I show that every context-free language over a unary alphabet is regular?
|
When reading the literature on declarative programming technology. A particular technology that sounded promising is active databases. It essentially allows the programmer to specify rules about data that generate more data. On face value it seems like a great thing to have when compared to your neighborhood average im... |
There is a saying by Computer Science Professor's everywhere :
PDA Checks the intelligence of Students, as certainly there is no approach except power and imagination
of mind to solve problems and design PDA...
While thinking today i thought How can we design automata of a^2n b^(2n-1)
I tried my best :
For example let... |
I am trying to convert the following 2-sat clauses to implications and then draw the implication graph.
The clauses are: {¬xvy}, {¬yvz}, {¬zvw} ,{¬wvu},{¬uv¬x},{xvw},{¬wvx}
I converted the boolean literals into implications so I could construct the implication graph:
{¬xvy}: I have x-->y and ¬x -->¬y
{¬yvz} : I have y-... |
I'm looking at the lecture review for one of my computer science classes and I'm having trouble coming up with an answer. Could someone help me work through it?
Background:
Let the balance factor of a node be defined by $\left| height(\text{right sub tree}) - height(\text{left sub tree}) \right|$.
Questions:
Give the... |
I was recently asked to explain eye tracking to 4th grade students and talk to them about its applications.
What is eye tracking?
An eye tracker is a device that uses projection patterns and optical
sensors to gather data about gaze direction or eye movements with very
high accuracy. Most eye trackers are based on... |
I am doing a presentation about Turing machines and I wanted to give some background on FSM's before introducing Turing Machines. Problem is, I really don't know what is VERY different from one another.
Here's what I know it's different:
FSM has sequential states depending on the corresponding condition met while Turi... |
Computer Language/Logic Examples?
These are some of the questions i am having within a few chapters of my automata class and would like some help if you could :) Class is online and can be hard to self teach at times, you dont have to answer all or any for that matter, just thought id ask i got a midterm coming up and ... |
I'm considering an automaton $A$ over a alphabet $\Sigma$, with a set of states $Q$, such that $\Sigma \subset Q$, which includes special "accept" and "blank" states not in $\Sigma$. It also has an infinite list of cells, which begins with the input string, the rest being blank. It has a transition function $\delta: Q ... |
I am looking for an easy and introductory paper on the proof of Courcelle's Theorem. I am also interested in its connection to parameterized complexity regarding the treewidth.
I am only a beginner in this field.
Any suggestions?
|
An undirected graph is a Near-Clique if adding one more edge would make it a clique. Formally, a graph $G=(V,E)$ contains a near-clique of size $k$ if there exists $S\subseteq V$ and $u,v\in S$ where $|S|=k$, $(u,v)\notin E$, and $S$ forms a clique in $(V,E\cup\{(u,v)\})$. How can I show a direct reduction from Near-Cl... |
Given a string $(a_0,a_1,\ldots a_n)$. I want to find the length of the longest common prefix of the substrings $(a_0,a_1,\ldots a_{n-1})$ and $(a_1,a_2,\ldots a_n)$. I know this has atleast $O(n)$ complexity. Lets call this operation as prefix-suffix match.
I want to calculate prefix-suffix match length for all suffix... |
What is the efficiency of Concorde TSP solver program. And is it have any weaknesses? I build my own exact solver and I want to compare it to Concorde. What would be the best way to do this?
|
I'm enrolled to a Formal Language And Automata course, and we have to prove this equation on sets of strings:
$$(L_1\cap L_2)\cdot L_3 ≠ (L_1\cdot L_3) \cap (L_2\cdot L_3)$$
I've tried a lot of sets for e.g.
$L1 = \{a,b,c,d\}$,
$L2 = \{a,f,g\}$,
$L3 = \{s,d,h\}$.
but always the LHS comes out equal to the RHS instead of... |
I'm interested in finite state automata which have the capacity to require repetition. That is, the machine may be in a state in which the next character may be any character from set $S$, but, whatever character there is, it must be repeated 3 times. Or it may be in a different state, which requires a character from... |
What notation is used to discuss the coefficients of functions in big-O notation?
I have two functions:
$f(x) = 7x^2 + 4x +2$
$g(x) = 3x^2 + 5x +4$
Obviously, both functions are $O(x^2)$, indeed $\Theta(x^2)$, but that doesn't allow a comparison further than that. How do I discuss the the coefficients 7 and 3. Reduc... |
I've been stuck with this problem for 2 weeks. Any idea of how to aproach it?.
Let $L$ be a list of $n$ different integer numbers, assume that the elements of $L$ are in the range $[1,750]$. Design a linear ordering algorithm to order the elements of $L$.
I already tried with insertion sort. But I'm not sure if my ap... |
I have an Euclidean, undirected graph: each vertex is a point on the 2D plane, so the weight of each edge is the Euclidean distance between the vertices.
The number of vertices with no edges is small in comparison to the total number of vertices.
No vertex has more than two edges connected to it.
How can I convert t... |
I have read that the NFA size (i.e., the number of states) is linear in the number of characters in the regular expression. This holds even in the presence of character repetitions.
I would like to know why is it so?
If I have a pattern like this , [b-d]at then the number of states will be just 4 incase of NFA ? Size... |
Given two ordered sets of words $a_1, a_2, ..., a_k$, $b_1, b_2, ..., b_k$ taking values in some discrete alphabet $A$, a solution to the PCP problem is a sequence $i_1, ..., i_n$ taking values in $1, 2,..., k$ such that $a_{i_1}|a_{i_2}|...|a_{i_n}=b_{i_1}|b_{i_2}|...|b_{i_n}$ where $|$ means concatenation. $k$ can be... |
Let $C$ be an infinite set of characters. I'd like an abstract machine which can recognize sequences consisting of $k$ (constant) of repetitions of a char from $C$.
For example, if ${x,y,z} \subset C$, and $k = 3$, it should recognize $xxx$ but not $ddd$ or $xyz$. (The same char must be repeated.)
Since $C$ is infini... |
How can I show that this language is not regular?
$$
L = \{a^n (ca)^m b^{n+1} \mid m \ge 0 , n \ge 0 \}
$$
This is my attempted solution:
Assuming the pumping number to be $p$ and making $m=0$
the language reduces to $a^p b^{p+1}$ so $s=a^p b^{p+1}$
let $s=xyz$ where $y$ is not $\epsilon \\$
$y=a^k$; $0 \lt k<=p$
... |
I understood that we can apply FPTAS to the weak NP problems like 0-1 knapsack.
But why we cant apply the same principle to the strong NP problems like bin packing? I also checked wiki page about the same but understood very less.
|
For the following schema
Country ("countryID", cName)
CoffeeShop ("shopID", sName, countryID, city)
Product ("productID", size)
Serves ("shopID", "productID")
ProductNames ("productID", "countryID", pName)
where attributes in quotation marks are primary keys, I must write a relational algebra statement for the followi... |
Any CS class about caches will at some point address this classical formula (or a variant of it)
Effective_access_time = hit_time + miss_penalty * miss_rate
My question is simple: does this formula have a "name" ? (i.e. unambiguous, and ideally, well-accepted too). I found plenty of references to many variants of that... |
Does coNP-completeness imply NP-hardness? In particular, I have a problem that I have shown to be coNP-complete. Can I claim that it is NP-hard? I realize that I can claim coNP-hardness, but I am not sure if that terminology is standard.
I am comfortable with the claim that if an NP-complete problem belonged to coNP, t... |
I have a problem in understanding how to prove the following question.
Let $Q = \langle\max,f,L\rangle$ be an NPO-Problem, where $f$ only supports integers.
Define $$L_Q^* =\{(x_0,1^k) : \exists x . L(x_0,x) \land f(x_0,x) \geq k\}.$$
The instance of $x_0$ is binary coded, while the numerical parameter $k$ is unary co... |
Let:
$\left\{m_1, ~...~, m_k\right\}$ be a set of coprime natural numbers,
$M=\prod_{i=1}^{k} m_i$
$X$ be a natural integer, such that $X < M$
Then $X$ can be expressed in the Residue Number System as:
$$X={\left(x_1, ~...~, x_k\right)}_{RNS\left(m_1, ~...~, m_k\right)}~.$$
Where $\forall_{m_i} \left[\left(x_i \equiv... |
I have graphs $G_k$ and $H_k$ with $|\mathcal{V}(G_k)|=|\mathcal{V}(H_k)|^{2k}=n^{2k}$ with $k\in\Bbb N$ that pass sanity checks such as no-homomorphism lemma. Are there free and easy to use tools to test graph homomorphism from $G$ to $H$?
|
Ok, I must admit this a task from my studies but I'm stuck.
Rules of the game are on Wikipedia. However, we have a modified version: on input we have a board with x fields, there are y penguins on some fields, there may be gaps between fields. All penguins are the same, they can move only to the farthest possible locat... |
I'm interested in the question of how best to teach NP-completeness to computer science majors. In particular, should we teach it using Karp reductions or using Turing reductions?
I feel that the concepts of NP-completeness and reductions are something that every computer science major ought to learn. However, when t... |
So I have the question:
Prove that any directed cycle in the graph of a partial order must only involve one node.
So I know that a partial order must be transitive, antisymmetric, and reflective, but from there I am pretty lost. I also know that any path of one or more edges from a node to itself is a directed cycle, b... |
Consider the following problem:
There are $n$ points in the plane.
Starting from one of them I want to visit each of them once (except the starting node which has to be visited twice) but in a way that minimizes the cost of the total path.
The weight of each edge changes depending on the path followed.
For example imag... |
Is it possible to solve a parity game in polynomial time? If yes, how? If no, why not?
|
I have come across a question that is a bit hard to understand due to its wording, I may havecome up with a possible solution, but I don't know if it's correct. Can you please help me? Thanks in advance!
Question
Suppose we exchange elements $a[i]$ and $a[j]$, where $j > i$, which are originally out of order.
For examp... |
I want to know difference between propagation speed and bandwidth in digital communication.I know bandwidth is no of bits in one second and propagation speed of signal is distance traveled by signal is one second.Is there any relation between them or they are totally different.Can anyone tell me exact definition to dif... |
Is there a name for this infinite language?
$$L = \{ 0(,1)^*(,2)^*(,3)^*....(,n)^* \;\mid n \geq 1\}$$
A string $w \in L$ is simply an ordered list of increasing integers in which every integer $\geq 1$ can be repeated 0 or more times, for example "0", "0,1", "0,1,2,2", "0,1,2,3", "0,1,1,4,4,4,21,21".
Or perhaps a nam... |
I have $k$ lists that I would like to combine to a single list. Each list's elements are unique and are sorted in a particular order, but there is no notion of an absolute order, and different items across lists can only be compared if they are equal. To give a specific example (here I use $<$ to indicate the sorting i... |
The grammar is
$$ S\to aSb\ |\ bSa\ |\ SS\ |\ \epsilon. $$
I think this generates the set of strings with equal numbers of $a$'s and $b$'s based on examples I've done. Is this correct?
|
Consider the following problem:
Give an algorithm to find the $1^{st}, 2^{nd}, 3^{th}$ fastest horses from 25 horses. In each round, at most 5 horses can race and you can get the exact position of these horses. Analyze the lower bound of this problem using adversary argument. One race is considered as one critical ope... |
I have an Euclidean graph: each vertex is a point on the 2D plane, so the weight of each edge is the Euclidean distance between the vertices.
I am randomly creating a path thru all the vertices and I want to know if there is any efficient way to find all the intersections on my path.
|
Let $G$ be a graph on $|\mathcal{V}(G)|$ vertices. If $H$ is another graph that contains a clique of size $|\mathcal{V}(G)|$, then does it mean $G$ is subgraph isomorphic to $H$? Does this mean that all graphs with vertices less than $|\mathcal{V}(G)|$ are subgraph isomorphic to $H$?
If the above is not the case, is th... |
I think the Question is self sufficient. Is the syntax of C Language completely defined through Context Free Grammars or do we have Language Constructs which may require non-Context Free definitions in the course of parsing?
An example of non CFL construct i thought was the declaration of variables before their use. Bu... |
I am a microbiologist and I am currently self-studying machine learning from some open lecture videos. I am finding it pretty difficult to understand proofs that are somewhat "obvious", my poor mathematical knowledge is to blame for that. Can you please recommend a text-book that deals with the mathematical proofs of t... |
I have a table in which some values are repeated often as shown in the figure below. I want to encode that table such that it makes use of less memory. I have heard about run length encoding (RLE) but I would like to know if there are any other such encoding techniques or algorithms which can perform better than RLE or... |
Eagle, et al [1] discuss the notion of node entropy and this is captured in igraph via the diversity metric. I was wondering if there was any relationship between these node entropies and the idea of the entropy for the entire graph.
A related question: Does the concept of edge entropy make sense? The probability would... |
A ranking algorithm determines the position (or rank) of a combinatorial object among all the objects (with respect to a given order); an unranking algorithm finds the object having a specified rank. Thus, ranking and unranking can be considered as inverse operations.
The following lattice has 9 unique max length pat... |
I am taking an undergraduate CS Theory course and the material on finite automata and regular languages is being taught in a non-traditional manner. Instead of using regular expressions, the closure properties of regular languages, the pumping lemma etc, to show that a language is or is not regular, all of our proofs a... |
I have an Euclidean graph: each vertex is a point on the 2D plane, so the weight of each edge is the Euclidean distance between the vertices. I found a geometric proof that every optimal TSP solution contains no intersections.
How many non-intersecting routes could be there? Or in other words: what is the probability ... |
I'm having trouble understanding why it's easy to detect negative-weight cycles (Bellman Ford) but hard to find the maximum weight cycle in an undirected graph.
If we negate the weight of each edge, we can easily find if there are any cycles with total weight > 0. However it must not be easy to find if there are any c... |
Having the grammar G = (V,P,S) with variable V = {S,A} over the alphabet {a,b} with the rules:
S->aA
A->Sbb|b
How can i recognize which kind of grammar is this? I think that's not "regular expression" because in the second rule there are 2 letters (bb) instead of one, so i think it's a "context free" grammar. Am i ri... |
Construct a context-sensitive grammar that generates L:
L = {a^n b^m c^k|k>n, k>m}
I believe my productions should go along this lines:
S-> ABCC
A-> a|aBC|BC
B-> b|bBC
C-> c|Cc
CB->BC
The idea is to start with 2 c and keep always one more c, and then with C->c|Cc ad as much c as i want.
How can my production for C r... |
I'm looking for an actual definition of a stream processing unit (SPU), preferably sourced. The context is not specifically graphics cards.
I can find many, many articles explaining what they contain, or what they do in specific cases, but I need a definition for an informal class presentation. I have a general sense o... |
I have been looking for a quick and easy explanation on Quick Select and stumbled upon this. It's quick and easy to follow, but there's a part which I am not following quite well:
The uploader is sorting the following array using the 4th smallest element
2 6 5 1 4 9 3, pivot is 2 and last element is 3
We rearrange, the... |
In Types and Programming Languages, the family of sets of terms with de Bruijn indices in the untyped $\lambda$-calculus is defined in this way:
Let $T$ be the smallest family of sets $\{T_0, T_1, T_2, ...\}$ such that
$k \in T_n$ whenever $0 \le k \lt n$;
if $t_1 \in T_n$ and $n \gt 0$, then $\lambda. t_1 \in T_{n-1}... |
I can't answer this question. It seems simple but I really don't know how to approach it.
Here it is:
A priority queue is said to be stable if deletions of items with equal priority value occur in the order in which they were inserted. Which of the following priority queue structures are stable:
linked lists ordered ... |
Given a tree $T$ and a sequence of nodes $S$, with the only constraint on $S$ being that it's done through some type of recursion - that is, a node can only appear in $S$ if all of its ancestors have already appeared, what's a good algorithm to determine if $S$ is a breadth first visit, a depth first visit, or neither?... |
I am unclear about finding the memory complexity of an algorithm.
Some places refer memory complexity as what container would be carrying for instance:
for i = 1 to n-1
if d[i] == d[i + 1]
d[i] = (d[i] + 5) mod 13
Is considered as having $\theta(N)$ memory complexity.
At some other places how much data... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.