instruction stringlengths 35 11.4k |
|---|
So I'm building this iterative simulation of a surface (composed of line segments) that cannot self-intersect, which means I have to check intersections at the end of a timestep. The thing is, I know, at the beginning of every timestep, that no intersections exist within the set of all line segments that constitute the... |
$L = \{w \mid M_w \text{exists and it accepts a word } x_1 = 0x \text{ if and only if it accepts } x_2 = 1x\}$ ($x \in \Sigma^*$, so $x_1$ is starting with a 0 and $x_2$ is obtained from $x_1$ by changing the first 0 to a 1).
|
Studying for an exam and considering the general set of languages that solve the problem of whether or not some condition is fulfilled while processing a string.
I consider the language L_overwrite which solves the problem of if one arbitrary character overwrites another different one.
I'll call these arbitrary charact... |
Let me first say I come from a physics background and have about zero exposure to computer science, so the question may be very naive. Shannon's entropy looks perfectly natural and useful from a statistical/thermal physics point of view, but now I'm trying to understand how it is applied for real computers.
Normally t... |
Let $k,n,K,m \in \mathbb{N}$ such that $k<n$. Let $l\in \mathbb{R}$, such that $0 \leq l \leq 1$. I am analyzing an algorithm and I need $O(N)$. Could you help me with the reduction of the expression $N$:
$$N=\log_S(1-\sqrt[K]{l})$$
where
$S=(\sum_{i=1}^m 2^{k-n}\binom ni)/2^{k}$
Using hint of DW, I try.
$$N=\log_S(1-\... |
I came across this question in an exam book and was unable to find a solution:
Prove that C(n) = {a^k | k is a multiple of n} is a regular language for every natural number n ≥ 1.
I wasn't able to construct a DFA as the number n is left variable in the original question. Is it possible to construct a DFA with a variabl... |
Let's say you want the top k elements. Then given the array, there is an O(n) O(n) space approach. But what if you have a stream of elements, this means that each time you'd append an element to the end of your list, you'd have to do this O(n) time O(n) space approach. Let's say your elements are distinct elements of a... |
The problem statement can be made as follows. There is a 1D length of raw material that contains "net" and "waste" intervals. Using 2n cuts, sections of material can be removed so that less waste has to be processed later. For a given value of n, where should the cuts be placed so that the amount of waste that is remov... |
Given two arrays $A$ and $B$ of integers, both of size $N$, such that for all $0 \le i \le N-1$, $A[i] \ge B[i]$, we have to convert array $A$ to array $B$. For this we can do only one type of operation: choose some $l$ and $r$ ($0 \le l \le r \le N-1$) and set the values of $A[l],A[l+1],\ldots,A[r]$ to $k$, where $k \... |
If an algorithm runs in $O(|V||E|)$, is its running time bounded by some polynomial of $|V|+|E|$? If not, what is its running time called?
|
I already saw this answer. But I didn't understand totally.
So I found the solution to this equation $T(n)=4T(n/2+2)+n$.
Here is the recursion tree. But I can't compute the height as $lgn$ from this tree.
How to compute height? (Image is from solution)
|
Let's say we have given $n$ points on the x-axis, each point described with two integers: $x_i, a_i$, $x_i$ meaning it's position on the x-axis, and $a_i$ meaning that it can activate all the points that lie in the range $[x_i, x_i + a_i]$.
The problem is for each of those n points to find the maximum number of points ... |
Hopefully I am posting this in the right place, I am currently in a course of knowledge representation, and I came across an exercise about entailment:
$$A\land\neg A\vDash C\,.$$
I would argue that this expression is not entail, but it is actually entailed, but I don't see how, can you help me figure out why?
|
So maybe I'm confused in these concepts
but i thought that time sharing computer is a computer which the processor switches between different processes quickly to achieve a good response time
but isn't this the same as Round Robin algorithm?! i mean aren't we scheduling between different processes in Time sharing c... |
Let $k \in \mathbb{N}$ and $m \in \mathbb{R}$. Consider the following function $S\colon \mathbb{R} \times \mathbb{N} \to \mathbb{R}$:
$$
S(m,k) = \begin{cases} 3m & \text{if } k = 0, \\ 4S(\tfrac{m}{2},k-1)+3m & \text{if } k \geq 1. \end{cases}
$$
Find a closed-form expression for $S(m,k)$ using repeated substitut... |
Consider a restriction on 3-SAT in which no literal occurs in more than two clauses.
How do we show that this is NP complete ?
(edit - I was getting confused over the definition on the 3-SAT,here by 3-SAT it implies that a clause can have at most 3 literals.)
|
I do not understand how do you write schduled loop from unscheduled one. The unscheduled loop straightforward if you follow the stall rules.
The rules say you are supposed to stall after L.D but in the right loop theres no stall.
|
Given a CFG for a (infinite) language $L$, is there an efficient algorithm that generates all possible words of length $n$ in $L$?
Preferably efficient in time, and with low memory usage.
I'm only interested in the words themselves - not their derivations. If the language is ambiguous and has multiple derivations for a... |
I have to write all possible Red Black Trees which can represent these 5 numbers {1,2,3,4,5}.
Now we have 120 ways to write 1,2,3,4,5
{1,2,3,4,5} {1,2,3,5,4} {1,2,4,3,5} {1,2,4,5,3} {1,2,5,3,4}
{1,2,5,4,3} {1,3,2,4,5} {1,3,2,5,4} {1,3,4,2,5} {1,3,4,5,2}
{1,3,5,2,4} {1,3,5,4,2} {1,4,2,3,5} {1,4,2,5,3} {1,4,3,2,5}
{1,4,3... |
I am working on a Systematic Literature Review (SLR) and about to done with data synthesis. After SLR, I want to create an Ontology and include different details of the SLR in Ontology. I have almost completed the practical steps, but unable to write the motivation behind using Ontology in SLR.
I want you all to please... |
I am writting a small compiler for a compilers' class. The algorithm is having a shift/reduce conflict when I try to enclose if-else with braces '{', '}'.
The non-ambiguous if-else statement I took from the dragon book, which turns to be ambiguous when I add the braces. To build the parser and test it I am using the P... |
The shared bus between the program memory and data memory leads to the von Neumann bottleneck, the limited throughput (data transfer rate) between the central processing unit (CPU) and memory compared to the amount of memory. Because the single bus can only access one of the two classes of memory at a time, throughput ... |
Is there a way possible to find the middle element of a doubly linked list using head and tail. I tried traversing to the next element from the starting node and the previous element from the end node and check if the reference of both is same or not. This works fine if there are odd number of elements in the list. I a... |
Do all longest paths share a common point? (Gallai 1966)
A few years later, Walther produced a counterexample on 25 vertices (a). The simplest counterexample was found by both Walther and Zamfirescu independently and has 12 vertices (b).
I found this examples in numerous study, but i couldn't find a vertex that doe... |
There is a universal metric of information: amount of bits. It's universal in the sense that if we write a piece of information in DNA (4-ary digits), we can simply multiply by 2-log-4 to get the amount of bits.
I'm wondering if there is also a universal measure of the size of a program. I know about Kolmogorov comple... |
In his paper The Bose-Nelson Sorting Problem (1973, Chapter 15 of A Survey of Combinatorial theory on page 163 available on Google books), Knuth says that the optimal bound of 5 comparators for a 4-input sorting network comes from an "elementary information-theoretic argument".
Information theory is not a part of my to... |
This has been confusing me for a while, how do we exactly choose the pumping length when we want to prove whether a language is CFL or not. For example, when we want to prove that {ww, w: {0,1}* } why do we choose p = n as 0^p 1^p 0^p 1^p ?
|
I'm a bit confused regarding the relation between trace equivalence and bisimilarity. These lecture notes I found and a few others documents I've read state that "if an LTS is deterministic then two states are bisimilar if they are trace equivalent".
When reading around the topic I found this page, which shows the fol... |
I know Shannon Entropy is defined for messages. When it's said the size of a file stored in a HDD is 1 MB, are we talking about the Shannon Entropy? If so, how do we extend the definition to static information (not flowing like messages)? If not, how come they have the same unit, i.e. bits?
|
This is a follow up to the following question: Bounded Quadratic Congruence Problem Variant (for some specific Residue)
As indicated that for square residue the problem is solvable in polynomial time. Let us consider a modified version of the same problem:
Given: 3 positive integers $a,b,L$. Problem: Is there a positiv... |
Suppose we call two finite state machines equivalent if they "perform the same computation" - they accept the same language, or they produce the same output for any given input. Is there an algorithm for checking if two finite state machines are equivalent?
|
When encoding a a 2D Datamatrix barcode, I want the smallest output size. There are means to encode a compressed a string using some methods like C40.
Reference:
Here's a reference: https://en.wikipedia.org/wiki/Data_Matrix#Text_modes
Some sections of the string will compress more efficiently than others depending on t... |
Schema:
http://comet.lehman.cuny.edu/jung/cmp420758/DBMidexamFa14-SelectedSolution.pdf
Write SQL code to find the following details:
For each project: find the project number and the number of employees who do not work on the project but who work on a different project controlled by the same department.
Edit:
Here is m... |
We have given binary matrix (matrix containing only 1 and 0) of size $n\cdot m$. We want to order the matrix such that the biggest rectangle containing only ones is with maximum size.
For example if the following matrix is given:
1000 0010
1101 0111
1101 0111
1101 0111
We should output 9 because the biggest rectan... |
I was thinking about how the BitTorrent protocol automatically gives every peer a list of IPs of every other user who is currently seeding / leeching off the torrent in question. Is there an existing protocol where, somehow, the destination address is vague enough or unknown to the sender (and perhaps becomes more know... |
I am very new to Graph Theory and I am trying to prove the following statement from a problem set for my class:
Prove that if G is a regular graph on n vertices $(n \ge 2)$, then $\omega(G) \in \{1, 2, 3,... \lfloor n / 2 \rfloor, n\}$
I am confused by the part where it places the clique number to be in this set: $\... |
I need to generate the shortest possible path for aerial photography using a fixed wing unmanned air vehicle (UAV).
The image below shows the area I'm going to search. The white cells are the cells I want to photograph (must be traversed), and the black tiles are not of interest (doesn't have to be traversed). The midd... |
On a recent trip to the London Science Museum I saw Babbage’s Analytical Engine.
Apparently this had an ALU (or equivalent). Is the Analytical Engine binary? I can build an ALU out of logic gates but I can’t conceptualise how to do it with gears. I’m trying to map across the concepts.
My question is: Can you explain ... |
A polynomially bounded Turing machine is the one which, on input $w$, uses no more than $f(|w|)$ cells on its tape, where $f$ is a polynomial. For this problem halting is decidable.
I do not understand why is halting decidable for this problem because $f$ is unknown to us.
|
Generally speaking, an algorithm takes some inputs and provides some output. I would like to understand how the algorithm performs when the inputs are incomplete for various real-world reasons. Are there any papers on this issue?
|
I am taking an introductory course in complexity theory, and as an exercise, we were given the following problem.
Consider the bin packing problem, with objects of positive (rational) weights $W = \{w_1, w_2, ..., w_n\}$ ($0 < w_i \leq 1 \forall i$) that should be placed in bins of capacity 1. Imagine that you are give... |
From what I understand, designing an IT security systems requires to build an algorithm D which can decide whether any program M is malicious or not.
That tasks looks very similar to me than deciding a non-trivial property of an arbitrary large set of programs. And as we know by Rice or diagonalization or many differen... |
I have to find an unambiguous context-free grammar that generates the following language. $$L= \{ w \in \{a,b\}^+ : |w|_a = |w|_b\}$$
I think I have found the context-free one, it should be this one.
$$S \to aS'bS'|bS'aS'$$
$$S' \to aS'bS' | bS'aS' | \lambda$$
Now I am stuck with proving whether it is unambiguous or no... |
The first line of the Wikipedia article on Moore's law states that
Moore's law is the observation that the number of transistors in a dense integrated circuit doubles about every two years
As scientists groan on about running into the physical limits of Moore's law, another bunch of scientists[or the media?] seems to... |
In my last test, our teacher gave us this question:
In an conference with 90 participants, the staff wants to divide all
participants in 6 groups of 15 participants each. Each participant of
each group must have at least one article with exactly 7 other
participants of the same group. Prove using Graph Theory th... |
Prove that $L_2 = \{ w \in \{a,b\}^* \mid w = a^ib^j, i \neq j \}$ is not regular.
I was wondering if my intuition holds for proving this language as not regular:
Let $q = \max(i, j) - \min(i, j)$.
Case 1: $i > j$
Let $$L_3 = b^q \Rightarrow L_2 \cdot L_3 = \left \{ a^ib^{j+q} \right \}=\left \{ a^ib^i \mid i \ge 0 \... |
If we assume that NP is not equal to co-NP, how do we show that EXPTIME \ NP is not a subset of NP-Hard?
|
Suppose in an NFA we have an $\varepsilon$-move from a state $q_0$ to $q_1$. According to Sipser,
Without reading any input, the machine splits into multiple copies one following each of the exiting $\varepsilon$-arrows and one staying at the current state. Then the machine proceeds nondeterministically as before.
He... |
I want to implement a tournament managing software , something like challonge(https://challonge.com/) and am currently stuck at the data structure to be used. I read up on tournament trees and a format like this, https://i.stack.imgur.com/UOMVI.png . The problem I am facing is in balancing it.
The method works very wel... |
Square braces around a grammar symbol or symbols denote that these constructs are optional. Thus, production A -> X[Y]Z has the same effect as the two productions A -> XYZ and A -> XZ.
Curly braces around a grammar symbol or symbols say that these symbols may be repeated any number of times, including zero times. Thus... |
For proving that $L$ is in NPC, why do we reduce a known $L'$ into $L$ and not the other way around i.e. reducing $L$ into $L'$.
|
$T(n)=4T(n/4)+\log n$
I'm solving this recurrence relation by master theorem.
$a=4, b=4$ , $n^{\log_b a}=n^{\log_4 4}=n$
$f(n)=\log n=O(n^{1-\epsilon})$
when $\epsilon<1$, it is correct. So, $T(n)=\Theta(n)$.
But I'm confused how can $n$ be an asymptotically tight bound of $\log n$?
I'm not sure my solution is correct.... |
Does the associative/commutative/distributive/etc property hold for arithmetic performed with IEEE 754 floats?
Obviously the answer is no to most of those questions, but do any of the properties of standard arithmetic hold? How can one formulate proofs (or at least proof-like statements) explaining why any particular p... |
Well the title pretty much says it all, I've heard our professor saying that the smallest strongly-connected components in DAG (directed acyclic graph) are its vertices. Sadly I was unable to ask him for explanation and now this is stuck in my head ever since.
|
(I can't seem to find actual definitions of these terms anywhere, only hints and guesses).
Is it fair to say, that:
Virtual address space is the amount of bytes that can fit into RAM cells of all virtual addresses belonging to this virtual address space (virtual address space HAS MANY pages HAS MANY virtual addresse... |
From Computational Complexity - A Modern Approach, it is claimed in a remark that the following holds true.
Remark 5.5
Note that $\mathbf\Sigma_1^p = \mathbf{NP}$ and $\mathbf\Pi_1^p = \mathbf{coNP}$. More generally, for every $i \geq 1$, $\mathbf\Pi_i^p = \mathbf{co\Sigma}_i^p = \{ \overline{L} : L \in \mathbf\Sigma_... |
Prove or disprove:
The following language $L$ is decidable:
$\{ \langle M, x\rangle: M \text{ is a Turing machine and } M(x) \text{ halts in less than } |x|^2 \text{ steps} \}$
So for proving I need to construct a TM $U$ if it accepts $L$, so $L$ is decidable, otherwise not.
My steps are:
$U$ = "On input $ \langle M, x... |
Prove or disprove:
The following language $L$ is decidable:
$\{ \langle M, t\rangle: M \text{ is a Turing machine and } \forall w \in \{0,1\}^* [M(w) \text{ halts in at most } t \text{ steps} ]\}$
So for proving I need to construct a TM $U$. If it accepts $L$, so L is decidable, otherwise not.
My steps are:
$U$ = "On i... |
Three processes A B C. When conducting the safety algorithm, no explanation that I've been able to find answers the question of how the processes are being compared. Is it the total processes added up, or every process individually must pass the '<=' operator, or is it like regular integers where Process A would be th... |
Is $L=\{\langle M\rangle\mid \text{$M$ is a Turing machine and $L(M)$ is uncountable}\}$ decidable?
My intuition is that it is not, but I'm not sure if Rice's Theorem applies in this case. If it is not decidable, how can I prove that using reducibility?
|
Is L = $\{\langle M,w\rangle \mid \text{$M$ accepts string epsilon or string $w$, or both} \}$ decidable?
I attempted to use Rice's Theorem for this question to prove that it is undecidable.
Is my approach in the right direction if I let S, the non-trivial subset of recognizable languages, in this case to be S = {L | ... |
Suppose we have random lines made with 2 points. and point has (x,y)
For example:
Now when we draw a random line you will see many lines intersect with each other. This eventually gives rise to bounded regions. How to find the vertex points for each bounded region?
My approach:
First we find all the intersection point... |
In some code I'm currently writing, I'm stuck on the following algorithm to implement. The goal is to find real world users using multiple different accounts.
I've a List of UserData. This list is pretty big (> 10M entries)
A UserData is defined as: { userId, List<TimeSegments> }. A TimeSegment is {connectionDate, dis... |
I'm doing research for a system that is based on rules. The goal of the system is to fire when some of the rules are true.
Explanation (requirements/working of the algorithm):
The algorithm will run in the background of an app. There will be a lot of data available about the user. The algorithm will apply the defined ... |
If you have directed and unweighted graph G how could you find a path from node s to node t that also goes through another node w? This could be a non-simple path.
|
Does anyone keep a database of (or including) linear codes with small covering radius? I'm specifically interested in the smallest-dimension codes known of covering radius R ($2\le R \le 4$ say) for each codimension (up to codimension 10 or 12) over various small fields, especially $\mathbb{F}_3$, $\mathbb{F}_5$ and m... |
Let $G = (V, E)$ be a weighted, directed graph with weight function $w : E \to R$, and let $s \in V$ be a source vertex. Assume that G does not contain a negative cycle reachable from $s$. Then, if we execute relaxation steps resulting in $d[v] = \delta(s, v)$ for all $v \in V$ . Then the predecessor subgraph $G_\pi$ i... |
I was reading an article and I saw this one:
'under the Exponential Time Hypothesis, Split Contraction cannot be solved in time $2^{o(l^{2})}\cdot n^{O(1)}$ where $l$ is the vertex cover number of the input graph'.
And next. 'it is easy to see that Split Contraction can be solved in time $2^{O(n\log n)}$'.
Could you p... |
How would you prove that product of two fully time constructible functions is fully time constructible?
I managed to prove for sum, but product seems more complicated
|
Intuitively it would seem like these equalities are false since DTIME(n) and DSPACE(N) are in terms of deterministic Turing machines and NP is non-deterministic, but I'm struggling to come up with a convicing argument as to why this is. I'm assuming that both the Time and Space Hierarchy Thoerems must be used but I'm j... |
I recently came across this question in my textbook.
$ \text{Let } L \text{ be a language over an alphabet } \Sigma \text{ that is accepted by some FSA.} $
$ \text{Prove that the language is also accepted by some FSA.} $
$ \operatorname{Max}(L) = \{x \in L : \forall y \in \Sigma^* - \{ \lambda \}.\ xy \notin L \}.... |
I have been stumped on the following question for a few hours now, I feel like I am missing some "aha" moment.
$\text{Suppose that } \{ a^nb^n : n \ge 1 \} \text{ is non-regular.}$
$\text{Prove using closure results that } \{ 0^i10^i : i \ge 1 \} \text{ is non-regular.}$
Starting off I assumed for contradiction tha... |
Given a grammar for a space delimited list of words:
S -> word { space word }
word -> [a-zA-Z]+
space -> [ \t]+
And given the input "Hello World", what token would a peek() operation return?
|
I have written a program which contains a while loop: while k < sqrt(n), so clearly my program evaluates $\sqrt{n}$ at each iteration of the while loop. (Note that $n$ and $k$ can both change throughout the loop, although I do not think that this is relevant to the question.)
I am required to calculate the number of ar... |
If this is not the right forum for this question let me know.
I am looking for a physical algorithm that can be easily followed by anyone not knowing much mathematics to get integer partitions of a number.
I have come up with the following way - but there is an issue (described later).
Suppose I want to divide number 1... |
In a previous post, I have asked:
Generally speaking, an algorithm takes some inputs and provides some output. I would like to understand how the algorithm performs when the inputs are incomplete for various real-world reasons. Are there any papers on this issue?
As a specific example, suppose
*the seller wants to sell... |
Suppose I have the expression $abcdef$ and I want a combinator $X$ that does this:
$Xabcdef=a(bcd)(ef)$.
Is it possible to express $X$ using just the $B$ combinator, defined by
$Babc=a(bc)$?
Is this possible in general? That is, if I have a string of letters without brackets, is there always a combinator in terms of $B... |
I am studying computer architectures in university and my teacher asked me if we can create a computer without PC/IP register?
|
From Wikipedia:
In computer engineering, microarchitecture, also called computer organization and sometimes abbreviated as µarch or uarch, is the way a given instruction set architecture (ISA), is implemented in a particular processor.
Computer architecture is the combination of microarchitecture and instruction set.
... |
i have to calculate the average branching factor of the given successor function(pseudo-code) for every $m,n \in N$:
succ (x,y) = {(x-1 `mod` m, y), (x+1 `mod` m, y), (x, y-1 `mod` n), (x, y+1 `mod` n)}
with $n \geq m^{2}+2, n \geq 1$ and {} represent a mathematical set.
What i know is that the average branching facto... |
Let's say we have millions of strings (each of them < 100 characters):
alpha
allo
blah
hello world
orlando
...
I know how a binary search tree or a trie can help to do "prefix search" (example: find all strings that match al*, i.e. beginning with al).
Which data structure / algorithm could be used to search patterns ... |
First of all, a definition of the operations:
Insert by index: insert element e at index n, increasing the index of all subsequent elements,
Delete by index: delete element at index n, decreasing the index of all subsequent elements,
Access by index: access element at index n.
The interface, therefore, is that of a D... |
Any ideas for proving that $L=\{\langle T \rangle : \text{ time complexity of $T$ is polynomial}\}$ is not Turing-recognizable?
|
Is there a simple example of a monotone Boolean function $f:\{0,1\}^m \to \{0,1\}$ that we know can be computed by a polynomial-size circuit, but cannot be computed by any polynomial-size monotone circuit? Ideally, I'd be especially interested in a simple example where there is an exponential gap between the size of t... |
In theory of distributed systems, I understand message complexity and time complexity are common performance measures, with the first being the number of messages sent in the overall execution of the algorithm, and the time being the number of "steps" it takes to complete the algorithm.
My question is, with asynchrono... |
A good exercise is to show $NC^1 \subseteq L$. (According to the complexity zoo page this was first shown by Borodin, 1977.) Although the details must be checked, the proof is simple: take the $NC^1$ circuit and do depth-first-search on the output gate of the circuit. Recursively evaluating the gates in the circuit wor... |
If a pointer specifies a point in memory, would the amount of space a pointer takes not be dependent on how much memory it could possibly range over?
So for example, if we have 4 locations of memory and a pointer, then the pointer can be 2 bits, but if we have $2^k$, we will need $k$ bits.
My confusion stems from peopl... |
The multiple choice knapsack problem (MCKP) can be defined as follows:
MCKP is known to be NP-hard in general. I have a special case of MCKP for which
$N_i=\{1,2,\cdots,|N_i|\}$, for all $1\leqslant i\leqslant k$ ;
$p_{ij}=j$, for all $1\leqslant i\leqslant k$ and for all $1\leqslant j\leqslant|N_i|$; and
$w_{i1}<w_... |
Users can be assigned to one experiment on my site. I have an API that developers use to trigger logic for each experiment. They call ExperimentEngine.run() to trigger the code logic for the experiment.
I would like to allocate users to each experiment, at the point where a user might be exposed to the logic for that e... |
I don't understand how linked list insertion is constant time. The larger the list gets, the more bits are required to specify memory locations, and then the more bits that must be edited to account for changes in pointers.
Where is my mistake here?
|
From Wikipedia, a symmetric matrix is a square matrix that is equal to its transpose. An example of this (I think) is an adjacency matrix with undirected edges, which is a square matrix representing links between elements (undirected in this case).
The thing is, the data is duplicated in this case (looking at it from a... |
Given a B+tree indexing scheme, wondering how a database actually goes and finds records matching a range query such as the following:
CREATE TABLE foo (
x int,
y int
)
SELECT * FROM foo
WHERE x > 10 AND x < 100
AND y > 20 AND y < 200
From my understanding this would require 2 b+trees, one for each property... |
What is an algorithm that will take as an input a flat list of objects with a varying degree of overlapping properties:
thing1 (instance of "Mammal", but we don't know this now)
-eatsFood
-reproduces
-hasMilk
thing2 (instance of "Emu", but we don't know this now)
-eatsFood
-reproduces
-laysEggs
-hasFeath... |
Can AVL trees be interned for fast equality comparison? Is there work on interning data-structures or can you show that this cannot be done in better than $O(n)$ time?
I recently implemented a rope data structure in Lua as an AVL tree.
However, I realized a since the ropes are not interned, they can't be used efficien... |
I was studying branch prediction & predication execution and faced a trouble..
I'm not quite sure whether I understood the concept of predication but based on what I have learned it is taking both taken and not taken at the same time.
For example, let's assume we have 'if' and 'else' each filled with 3 instructions.
Fo... |
As the title suggests, I'm trying to implement an algorithm to decompose a polygon into the minimum number of star-shaped polygons. I've been searching for quite some time but I can't find any algorithms or even anything theoretical to study on this problem online. The closest I found is decomposition to the minimum nu... |
In Wikipedia, it says
the transdichotomous model is a variation of the random access machine in which the machine word size is assumed to match the problem size.
However, a random access machine is by definition a register machine, whose registers can store any non-negative number.
In addition, the concept of "word" ... |
Using the elevator algorithm for processing disk requests, suppose requests arrive in the order: 8, 36, 34, 12.... (These numbers are cylinder numbers).
Suppose the direction is UP meaning that the arm is taking on higher requests. Here we can see that both 36 and 34 are higher requests but 36 comes before 34, So, I'm... |
I'm facing a problem described as follows:
You are given a set of $n$ types of rectangular 3-D boxes, where the i-th box has height $h_i$, width $w_i$, depth $d_i$ and value $v_i$. You want to create a stack of boxes with a height limit $H$ and maximize the sum of the values, but you can only stack a box on top of anot... |
So i need to draw a DFA for this language, i know i need to separate for 2 DFAs and than combine them both.
What is the approach ?
How do i do the $\Sigma^*$ inside the DFA ?
The 0100 condition is kinda easy, also the 11 language.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.