id
int64
1
141k
title
stringlengths
15
150
body
stringlengths
45
28.5k
tags
stringlengths
1
102
label
int64
1
1
text
stringlengths
128
28.6k
source
stringclasses
1 value
22,275
Finding representatives of equivalence classes
<p>I have a table of pairs of objects, which defines an equivalence relation. How can I extract a single object from each of the equivalence classes using relational algebra?</p>&#xA;&#xA;<p>It can easily be done with iteration. For example, associate a unique <code>classId</code> with every object, then for every pair...
relational algebra
1
Finding representatives of equivalence classes -- (relational algebra) <p>I have a table of pairs of objects, which defines an equivalence relation. How can I extract a single object from each of the equivalence classes using relational algebra?</p>&#xA;&#xA;<p>It can easily be done with iteration. For example, associa...
habedi/stack-exchange-dataset
22,277
Does splitting a process across 4 terminal windows decrease the time it takes?
<p>Basically, I using an algorithm called 'miranda' to look at miRNA targets and it only runs on a single thread. It compares everything in one file against everything in another file, produces a file as an output and runs off of the command line in terminal. The process took roughly 20 hours to create the output file....
algorithms cpu pipelines threads
1
Does splitting a process across 4 terminal windows decrease the time it takes? -- (algorithms cpu pipelines threads) <p>Basically, I using an algorithm called 'miranda' to look at miRNA targets and it only runs on a single thread. It compares everything in one file against everything in another file, produces a file as...
habedi/stack-exchange-dataset
22,281
Modelling 2 object situation with Propositional Logic
<p>I'm reading up on propositional logic, and I'm completely stuck on this example - spent the past few hours trying to figure it out! Any pointers would be appreciated.</p>&#xA;&#xA;<p>There's 2 trees, each with signs on. </p>&#xA;&#xA;<p>Sign 1/Tree 1: There are leaves on this tree, and no leaves on the other</p>&#xA...
logic
1
Modelling 2 object situation with Propositional Logic -- (logic) <p>I'm reading up on propositional logic, and I'm completely stuck on this example - spent the past few hours trying to figure it out! Any pointers would be appreciated.</p>&#xA;&#xA;<p>There's 2 trees, each with signs on. </p>&#xA;&#xA;<p>Sign 1/Tree 1: ...
habedi/stack-exchange-dataset
22,284
Why choose D* over Dijkstra?
<p>I understand the basis of A* as being a derivative of Dijkstra, however, I recently found out about D*. From Wikipedia, I can understand the algorithm. What I do not understand is why I would use D* over Dijkstra. To my understanding, Dijkstra gives a best path and D* works backwards from the end goal, but unlike A*...
algorithms graphs search algorithms efficiency
1
Why choose D* over Dijkstra? -- (algorithms graphs search algorithms efficiency) <p>I understand the basis of A* as being a derivative of Dijkstra, however, I recently found out about D*. From Wikipedia, I can understand the algorithm. What I do not understand is why I would use D* over Dijkstra. To my understanding, D...
habedi/stack-exchange-dataset
22,286
Finite representations and programming languages Countably inifite
<p>I'm going over some of the pre-requisite math regarding Automata theory, and finite representations.</p>&#xA;&#xA;<p>I read the following:</p>&#xA;&#xA;<ul>&#xA;<li><p>If ∑ is a finite alphabet the set of all strings over the alphabet&#xA;(∑*) is <strong>countably infinite</strong>.</p></li>&#xA;<li><p>The set of al...
discrete mathematics
1
Finite representations and programming languages Countably inifite -- (discrete mathematics) <p>I'm going over some of the pre-requisite math regarding Automata theory, and finite representations.</p>&#xA;&#xA;<p>I read the following:</p>&#xA;&#xA;<ul>&#xA;<li><p>If ∑ is a finite alphabet the set of all strings over th...
habedi/stack-exchange-dataset
22,288
Language Recognition Devices and Language Generators
<p>I have few CS textbooks with me which discuss languages, well actually 2 plus old course notes supplied a few years ago. I have been searching the web too any only seem to come up with vague responses just like the text books I have.</p>&#xA;&#xA;<p>My question is about language recognizers verses generators. </p>&#...
formal languages terminology automata
1
Language Recognition Devices and Language Generators -- (formal languages terminology automata) <p>I have few CS textbooks with me which discuss languages, well actually 2 plus old course notes supplied a few years ago. I have been searching the web too any only seem to come up with vague responses just like the text b...
habedi/stack-exchange-dataset
22,289
Finding prime factors of non-random key generator
<p>I have been working on a challenge i found on the internet. It is as follows:</p>&#xA;&#xA;<blockquote>&#xA; <p>You've stumbled onto a significant vulnerability in a commonly used cryptographic library. It turns out that the random number generator it uses frequently produces the same primes when it is generating k...
algorithms cryptography randomness primes
1
Finding prime factors of non-random key generator -- (algorithms cryptography randomness primes) <p>I have been working on a challenge i found on the internet. It is as follows:</p>&#xA;&#xA;<blockquote>&#xA; <p>You've stumbled onto a significant vulnerability in a commonly used cryptographic library. It turns out tha...
habedi/stack-exchange-dataset
22,301
Solving for the matrix $W$ in an equation involving $W \cdot W^{T}$
<p>Having large matrices, $W$ (the unknown) and $M$ (known), is it possible to solve for $W$ in this equation&#xA;$$W \cdot W^{T} = M,$$&#xA;where $M$ can have negative entries.</p>&#xA;
linear algebra matrices mathematical programming
1
Solving for the matrix $W$ in an equation involving $W \cdot W^{T}$ -- (linear algebra matrices mathematical programming) <p>Having large matrices, $W$ (the unknown) and $M$ (known), is it possible to solve for $W$ in this equation&#xA;$$W \cdot W^{T} = M,$$&#xA;where $M$ can have negative entries.</p>&#xA;
habedi/stack-exchange-dataset
22,307
How to represent a 0-valid boolean formula?
<p>I read in these two papers <a href="http://www.ccs.neu.edu/home/lieber/courses/csg260/f06/materials/papers/max-sat/p216-schaefer.pdf" rel="nofollow">http://www.ccs.neu.edu/home/lieber/courses/csg260/f06/materials/papers/max-sat/p216-schaefer.pdf</a> and <a href="http://people.csail.mit.edu/madhu/papers/noneed/fullbo...
complexity theory satisfiability
1
How to represent a 0-valid boolean formula? -- (complexity theory satisfiability) <p>I read in these two papers <a href="http://www.ccs.neu.edu/home/lieber/courses/csg260/f06/materials/papers/max-sat/p216-schaefer.pdf" rel="nofollow">http://www.ccs.neu.edu/home/lieber/courses/csg260/f06/materials/papers/max-sat/p216-sc...
habedi/stack-exchange-dataset
22,316
Suboptimal Solution for a combinatorial problem
<p>I have a cost function $f(X)=\|\hat{X}-X\|_2$ to minimize which depends on a $s\times s$ matrix $X$ where $\hat{X}$ is given and $\|X\|_2=\big(\sum_{i,j}x_{ij}^2\big)^{1/2} $. This matrix $X$ is generated by selecting only $s$ different rows from a matrix $B$ of dimension $n\times s$. At the end, we are going to cho...
optimization combinatorics parallel computing
1
Suboptimal Solution for a combinatorial problem -- (optimization combinatorics parallel computing) <p>I have a cost function $f(X)=\|\hat{X}-X\|_2$ to minimize which depends on a $s\times s$ matrix $X$ where $\hat{X}$ is given and $\|X\|_2=\big(\sum_{i,j}x_{ij}^2\big)^{1/2} $. This matrix $X$ is generated by selecting ...
habedi/stack-exchange-dataset
22,333
How to reformulate my problem as a mixed-integer quadratic problem
<p>I have an unknown $n$-dimensional vector $x$ whose analytical expression depends on the following sum $x = z + Ba$ where the vector $z$ and the matrix $B\in \mathbb{R}^{n\times s}$ are given. So the $s$-dimensional vector $a$ is to be computed to find $x$.</p>&#xA;&#xA;<p>The only assumption that we have is $x=0$ wh...
optimization combinatorics parallel computing integer programming
1
How to reformulate my problem as a mixed-integer quadratic problem -- (optimization combinatorics parallel computing integer programming) <p>I have an unknown $n$-dimensional vector $x$ whose analytical expression depends on the following sum $x = z + Ba$ where the vector $z$ and the matrix $B\in \mathbb{R}^{n\times s}...
habedi/stack-exchange-dataset
22,360
Proving that Max Weighted Independent Set is in NP
<p>What I'm trying to do is to show a problem in NP can be reduced to the min weight vertex cover problem </p>&#xA;&#xA;<p>I've chosen the max independent weight problem = &#xA;input: A graph G with weights on each vertex,&#xA;output: An independent set with the max total weight</p>&#xA;&#xA;<p>Before reducing, I've tr...
reductions np
1
Proving that Max Weighted Independent Set is in NP -- (reductions np) <p>What I'm trying to do is to show a problem in NP can be reduced to the min weight vertex cover problem </p>&#xA;&#xA;<p>I've chosen the max independent weight problem = &#xA;input: A graph G with weights on each vertex,&#xA;output: An independent ...
habedi/stack-exchange-dataset
22,371
What is the evidence that that types are more basic specifications, and specifications are more detailed types?
<p>In the book <strong>Type Theory and Functional Programming</strong> <a href="http://www.cs.kent.ac.uk/people/staff/sjt/TTFP/" rel="nofollow noreferrer">[Thompson, S 1999]</a> the author explains the relationship between specifications, types and proofs of functions:</p>&#xA;<blockquote>&#xA;<p>The equivalent specifi...
functional programming
1
What is the evidence that that types are more basic specifications, and specifications are more detailed types? -- (functional programming) <p>In the book <strong>Type Theory and Functional Programming</strong> <a href="http://www.cs.kent.ac.uk/people/staff/sjt/TTFP/" rel="nofollow noreferrer">[Thompson, S 1999]</a> th...
habedi/stack-exchange-dataset
22,387
What is the name two mutually idempotent functions?
<p>To clarify, in haskell, there is an <code>ord</code> function that gives the byte integer of a character (i.e. <code>ord 'a'</code> yields <code>97</code>); and there is a <code>char</code> function that takes the byte integer of a character and returns the character (i.e. <code>char 97</code> yelds <code>'a'</code>...
sets
1
What is the name two mutually idempotent functions? -- (sets) <p>To clarify, in haskell, there is an <code>ord</code> function that gives the byte integer of a character (i.e. <code>ord 'a'</code> yields <code>97</code>); and there is a <code>char</code> function that takes the byte integer of a character and returns t...
habedi/stack-exchange-dataset
22,389
QuickSort Dijkstra 3-Way Partitioning: why the extra swapping?
<p><img src="https://i.stack.imgur.com/qeA2F.png" alt="Algorithm"></p>&#xA;&#xA;<p>Given the algorithm above (taken from the <a href="https://d396qusza40orc.cloudfront.net/algs4partI/slides/23Quicksort.pdf" rel="noreferrer">slides</a> (p. 35) of the <a href="http://coursera.org" rel="noreferrer">Coursera</a> course “Al...
algorithms sorting quicksort
1
QuickSort Dijkstra 3-Way Partitioning: why the extra swapping? -- (algorithms sorting quicksort) <p><img src="https://i.stack.imgur.com/qeA2F.png" alt="Algorithm"></p>&#xA;&#xA;<p>Given the algorithm above (taken from the <a href="https://d396qusza40orc.cloudfront.net/algs4partI/slides/23Quicksort.pdf" rel="noreferrer"...
habedi/stack-exchange-dataset
22,396
Variants of the 3-Partition problem
<p><a href="https://en.wikipedia.org/wiki/3-partition_problem" rel="nofollow">The 3-Partition problem (wiki)</a> is a $\text{NP}$-complete problem which is to decide whether a given multiset of integers can be partitioned into triples that all have the same sum. It is well-known that the <a href="https://en.wikipedia.o...
complexity theory reference request np complete
1
Variants of the 3-Partition problem -- (complexity theory reference request np complete) <p><a href="https://en.wikipedia.org/wiki/3-partition_problem" rel="nofollow">The 3-Partition problem (wiki)</a> is a $\text{NP}$-complete problem which is to decide whether a given multiset of integers can be partitioned into trip...
habedi/stack-exchange-dataset
22,402
Context-free grammar for $L = \{a^n : n\leq2^{20}\}$
<p>I want to find a context-free grammar for $L = \{a^n : n\leq2^{20}\}$. There's one for sure. I approached it by two ways and both seemed dead end. One was to set a limit during the production of the new strings. But I don't think there's such a thing in CFGs. Second approach was to produce the strings of the languag...
formal languages context free
1
Context-free grammar for $L = \{a^n : n\leq2^{20}\}$ -- (formal languages context free) <p>I want to find a context-free grammar for $L = \{a^n : n\leq2^{20}\}$. There's one for sure. I approached it by two ways and both seemed dead end. One was to set a limit during the production of the new strings. But I don't think...
habedi/stack-exchange-dataset
22,409
Difference between BTSP and TSP
<p>I am wondering what is the difference between Bottleneck Travelling Salesman Problem and normal Travelling Salesman Problem?</p>&#xA;&#xA;<p>Thank you</p>&#xA;
algorithms traveling salesman
1
Difference between BTSP and TSP -- (algorithms traveling salesman) <p>I am wondering what is the difference between Bottleneck Travelling Salesman Problem and normal Travelling Salesman Problem?</p>&#xA;&#xA;<p>Thank you</p>&#xA;
habedi/stack-exchange-dataset
22,412
A NPDA for the language $L = \{w \mid w \in \{a,b,c\}^*, n_c(w) = n_a(w) + n_b(w)\}$
<p>Consider&#xA; the language $L = \{w, w \in \{a,b,c\}^*, n_c(w) = n_a(w) + n_b(w)\}$, where $n_q(\omega)$ is defined to be "the number of $p \in \omega$.</p>&#xA;&#xA;<p>I have tried a couple of PDA's that follow this whole idea of a stack-replacement kind of algorithm, but the reasoning behind it is incorrect. I kn...
formal languages pushdown automata nondeterminism
1
A NPDA for the language $L = \{w \mid w \in \{a,b,c\}^*, n_c(w) = n_a(w) + n_b(w)\}$ -- (formal languages pushdown automata nondeterminism) <p>Consider&#xA; the language $L = \{w, w \in \{a,b,c\}^*, n_c(w) = n_a(w) + n_b(w)\}$, where $n_q(\omega)$ is defined to be "the number of $p \in \omega$.</p>&#xA;&#xA;<p>I have ...
habedi/stack-exchange-dataset
22,413
How does binary addition work?
<p>I find <strong>binary</strong> confusing. I have watched minecraft redstone videos on binary adders, real binary adders, diagrams, etc and yet I have not learned much at all. <em>How does electrons flowing through wires made of gold "add/subtract" to make numbers through some logic gates?!</em></p>&#xA;
logic binary arithmetic
1
How does binary addition work? -- (logic binary arithmetic) <p>I find <strong>binary</strong> confusing. I have watched minecraft redstone videos on binary adders, real binary adders, diagrams, etc and yet I have not learned much at all. <em>How does electrons flowing through wires made of gold "add/subtract" to make n...
habedi/stack-exchange-dataset
22,418
What is the difference between RAM and TM?
<p>In algorithm analysis, we assume a generic one processor Random Access Machine (RAM). As far as I know, the RAM machine is no more efficient than the Turing machine. All algorithms can be implemented in the Turing machine. So my questions are:</p>&#xA;&#xA;<ul>&#xA;<li><p>If the Turing machine is as efficient as the...
turing machines computation models
1
What is the difference between RAM and TM? -- (turing machines computation models) <p>In algorithm analysis, we assume a generic one processor Random Access Machine (RAM). As far as I know, the RAM machine is no more efficient than the Turing machine. All algorithms can be implemented in the Turing machine. So my quest...
habedi/stack-exchange-dataset
22,426
Reduce Vertex cover to SAT
<p>I need to reduce the vertex cover problem to a SAT problem, or rather tell whether a vertex cover of size k exists for a given graph, after solving with a SAT solver. I know how to reduce a 3-SAT problem to vertex cover problem, by constructing the subgraphs for each variable (x, !x) and for each clause (a triable)....
complexity theory np complete reductions
1
Reduce Vertex cover to SAT -- (complexity theory np complete reductions) <p>I need to reduce the vertex cover problem to a SAT problem, or rather tell whether a vertex cover of size k exists for a given graph, after solving with a SAT solver. I know how to reduce a 3-SAT problem to vertex cover problem, by constructing...
habedi/stack-exchange-dataset
22,435
Time complexity of a compiler
<p>I am interested in the time complexity of a compiler. Clearly this is a very complicated question as there are many compilers, compiler options and variables to consider. Specifically, I am interested in LLVM but would be interested in any thoughts people had or places to start research. A quite google seems to brin...
compilers
1
Time complexity of a compiler -- (compilers) <p>I am interested in the time complexity of a compiler. Clearly this is a very complicated question as there are many compilers, compiler options and variables to consider. Specifically, I am interested in LLVM but would be interested in any thoughts people had or places to...
habedi/stack-exchange-dataset
22,459
Do the two huffman trees have the same corpus?
<p>Consider the following Huffman trees:<br>&#xA;<img src="https://i.stack.imgur.com/Q3bzR.png" alt="enter image description here"></p>&#xA;&#xA;<p>I was asked if those trees can have the same corpus. My answer was no, based on these calculations: </p>&#xA;&#xA;<p>For the right tree:<br>&#xA;$a_1 \le a_2$<br>&#xA;$a_1...
data structures trees information theory data compression
1
Do the two huffman trees have the same corpus? -- (data structures trees information theory data compression) <p>Consider the following Huffman trees:<br>&#xA;<img src="https://i.stack.imgur.com/Q3bzR.png" alt="enter image description here"></p>&#xA;&#xA;<p>I was asked if those trees can have the same corpus. My answer...
habedi/stack-exchange-dataset
22,468
How does one end up with a non-integer exponent in time complexity? (e.g., $O(n^{2.81})$)
<p>Periodically I come across sentences like </p>&#xA;&#xA;<p>"Winograd's variant [20] of this algorithm, whose asymptotic complexity is&#xA;also $O(n^{2.81})$ are considered" (from <a href="https://www.cise.ufl.edu/~sahni/papers/strassen.pdf">https://www.cise.ufl.edu/~sahni/papers/strassen.pdf</a>) </p>&#xA;&#xA;<p>I ...
complexity
1
How does one end up with a non-integer exponent in time complexity? (e.g., $O(n^{2.81})$) -- (complexity) <p>Periodically I come across sentences like </p>&#xA;&#xA;<p>"Winograd's variant [20] of this algorithm, whose asymptotic complexity is&#xA;also $O(n^{2.81})$ are considered" (from <a href="https://www.cise.ufl.ed...
habedi/stack-exchange-dataset
22,472
Why is non-determinism a useful concept?
<p>An automaton is an abstract model of a digital computer. Digital computers are completely deterministic; their state at any time is uniquely predictable from the input and the initial state. </p>&#xA;&#xA;<p>When we are trying to model real systems, why include nondeterminism in Automata theory? </p>&#xA;
automata nondeterminism applied theory
1
Why is non-determinism a useful concept? -- (automata nondeterminism applied theory) <p>An automaton is an abstract model of a digital computer. Digital computers are completely deterministic; their state at any time is uniquely predictable from the input and the initial state. </p>&#xA;&#xA;<p>When we are trying to mo...
habedi/stack-exchange-dataset
22,480
string matching vs integer matching
<p>How different are string matching and integer matching in terms of time complexity?</p>&#xA;&#xA;<p>I'm asking this especially in relation to Rabin Karp algorithm. Why is it faster to compute hash code for every substring and check for equality of hashcode with the hashcode of the given string than the naive method ...
algorithms strings substrings
1
string matching vs integer matching -- (algorithms strings substrings) <p>How different are string matching and integer matching in terms of time complexity?</p>&#xA;&#xA;<p>I'm asking this especially in relation to Rabin Karp algorithm. Why is it faster to compute hash code for every substring and check for equality o...
habedi/stack-exchange-dataset
22,495
Does a polynomial-time reduction from A to B imply that B is in NP if A is?
<p>Let f be a polynomial-time reduction of a decision problem A to a decision&#xA;problem B. We know that, if B $\in$ P then A $\in$ P. Similarly, if B $\in$ NP then&#xA;A $\in$ NP. However, what about the other direction? Assume that A $\in$ NP and&#xA;consider the following non-deterministic algorithms to decide whet...
complexity theory reductions np
1
Does a polynomial-time reduction from A to B imply that B is in NP if A is? -- (complexity theory reductions np) <p>Let f be a polynomial-time reduction of a decision problem A to a decision&#xA;problem B. We know that, if B $\in$ P then A $\in$ P. Similarly, if B $\in$ NP then&#xA;A $\in$ NP. However, what about the o...
habedi/stack-exchange-dataset
22,497
Why is it important for functions to be anonymous in lambda calculus?
<p>I was watching the lecture by Jim Weirich, titled '<a href="http://vimeo.com/45140590">Adventures in Functional Programming</a>'. In this lecture, he introduces the concept of Y-combinators, which essentially finds the fixed point for higher order functions.</p>&#xA;&#xA;<p>One of the motivations, as he mentions it,...
lambda calculus functional programming
1
Why is it important for functions to be anonymous in lambda calculus? -- (lambda calculus functional programming) <p>I was watching the lecture by Jim Weirich, titled '<a href="http://vimeo.com/45140590">Adventures in Functional Programming</a>'. In this lecture, he introduces the concept of Y-combinators, which essent...
habedi/stack-exchange-dataset
22,514
P, Q, ((P→Q)→R) ⊢ R using only modus ponens
<p>Can $R$ be inferred from $P$, $Q$, and $(P \to Q) \to R$ using only modus ponens?<br>&#xA;My understanding is that it can, as shown below, but I was told this was incorrect.</p>&#xA;&#xA;<p>Proof of ${P, Q, (P \to Q) \to R} \vdash R$ using modus ponens:</p>&#xA;&#xA;<pre><code>P, Q, (P-&gt;Q)-&gt;R : Given &#xA;Q,...
logic propositional logic
1
P, Q, ((P→Q)→R) ⊢ R using only modus ponens -- (logic propositional logic) <p>Can $R$ be inferred from $P$, $Q$, and $(P \to Q) \to R$ using only modus ponens?<br>&#xA;My understanding is that it can, as shown below, but I was told this was incorrect.</p>&#xA;&#xA;<p>Proof of ${P, Q, (P \to Q) \to R} \vdash R$ using mo...
habedi/stack-exchange-dataset
22,516
Why is Quicksort described as "in-place" if the sublists take up quite a bit of memory? Surely only something like bubble sort is in-place?
<p>Quicksort is described as "in-place" but using an implementation such as:</p>&#xA;&#xA;<pre><code>def sort(array):&#xA; less = []&#xA; equal = []&#xA; greater = []&#xA; if len(array) &gt; 1:&#xA; pivot = array[0]&#xA; for x in array:&#xA; if x &lt; pivot:&#xA; less...
algorithms sorting quicksort
1
Why is Quicksort described as "in-place" if the sublists take up quite a bit of memory? Surely only something like bubble sort is in-place? -- (algorithms sorting quicksort) <p>Quicksort is described as "in-place" but using an implementation such as:</p>&#xA;&#xA;<pre><code>def sort(array):&#xA; less = []&#xA; eq...
habedi/stack-exchange-dataset
22,525
Meyniel's theorem + finding a Hamiltonian path for a specific graph family
<p>Let's say we have a directed graph $G = (V, E)$ for which $(v, w) \in E$ and/or $(w,v) \in E$ holds true for all $v, w \in V$. My feeling is that this graph most definitely is Hamiltonian, and I want to find a Hamiltonian path in it (from any vertex to any other vertex, I don't care where to start or stop).</p>&#xA;...
algorithms graphs hamiltonian path
1
Meyniel's theorem + finding a Hamiltonian path for a specific graph family -- (algorithms graphs hamiltonian path) <p>Let's say we have a directed graph $G = (V, E)$ for which $(v, w) \in E$ and/or $(w,v) \in E$ holds true for all $v, w \in V$. My feeling is that this graph most definitely is Hamiltonian, and I want to...
habedi/stack-exchange-dataset
22,542
Maximum number of matched vertexes in a one-to-many bipartite graph
<p>I have a variant of bidding problem at hand.&#xA;There are N bidders(~20) who bid for items from a pool of many items(~10K). Each bidder can bid many items. I want to maximize the number of bidders who are satisfied. A bidder is satisfied if he gets all the items that he bid for in the first place. For eg-</p>&#xA;&...
algorithms graphs network flow bipartite matching max cut
1
Maximum number of matched vertexes in a one-to-many bipartite graph -- (algorithms graphs network flow bipartite matching max cut) <p>I have a variant of bidding problem at hand.&#xA;There are N bidders(~20) who bid for items from a pool of many items(~10K). Each bidder can bid many items. I want to maximize the number...
habedi/stack-exchange-dataset
22,554
Number of edges required to guarantee $K_3$ as subgraph
<p>I am trying to solve a given problem: Find an algorithm to determine if a graph has a clique of size 3 in $O(n^{2.81})$ steps. The hint given is that $2.81 &gt; \log 7$. In order to solve this I came up with a conjecture: if $m &gt; n^{\log 7}$ then the graph has $K_3$ as a subgraph. This will easily solve the probl...
graphs
1
Number of edges required to guarantee $K_3$ as subgraph -- (graphs) <p>I am trying to solve a given problem: Find an algorithm to determine if a graph has a clique of size 3 in $O(n^{2.81})$ steps. The hint given is that $2.81 &gt; \log 7$. In order to solve this I came up with a conjecture: if $m &gt; n^{\log 7}$ then...
habedi/stack-exchange-dataset
22,558
Does an enumerator print the first occurrence of a word in finite time?
<p>For a proof I need to use the fact that every word in the language of an enumerator occur on the output paper in finite time. Is it true?&#xA;For example, the language of the natural numbers in decimal representation. Can the enumerator print the odd numbers first and then the even numbers? (if yes, I am wrong)</p>&...
turing machines
1
Does an enumerator print the first occurrence of a word in finite time? -- (turing machines) <p>For a proof I need to use the fact that every word in the language of an enumerator occur on the output paper in finite time. Is it true?&#xA;For example, the language of the natural numbers in decimal representation. Can th...
habedi/stack-exchange-dataset
22,573
What's flawed about the "save-the-input" method of reversible computing?
<p>I'm an undergraduate just beginning to read about reversible computing. I know that, because of Landauer's principle, irreversible computations dissipate heat (and reversible ones do not). I brought it up with my professor, who had never heard of reversible computing before, and he was having difficulty understandin...
computability reversible computing
1
What's flawed about the "save-the-input" method of reversible computing? -- (computability reversible computing) <p>I'm an undergraduate just beginning to read about reversible computing. I know that, because of Landauer's principle, irreversible computations dissipate heat (and reversible ones do not). I brought it up...
habedi/stack-exchange-dataset
22,580
What is the expected number of nodes at depth d of a tree after i random insertions
<p>Suppose one wanted to build a tree at random. Let the first insertion at step $i = 1$ be the root node. From here, nodes are inserted into the tree at random one at a time. How would one go about calculating the expected number of nodes $E(d)$ at depth $d$ after $i$ insertions?</p>&#xA;&#xA;<p>For example, At $i ...
data structures trees average case
1
What is the expected number of nodes at depth d of a tree after i random insertions -- (data structures trees average case) <p>Suppose one wanted to build a tree at random. Let the first insertion at step $i = 1$ be the root node. From here, nodes are inserted into the tree at random one at a time. How would one go ...
habedi/stack-exchange-dataset
22,586
Relation between digraph and NP-Complete problem
<p>Can there be any relations regarding the number of nodes available in a digraph so that to qualify it as NP-Complete problem. &#xA;If we consider this problem for instance:<br/>&#xA;Input: A digraph $G=(V,E)$ and two nodes $u,v \in V$ <br/>&#xA;Question: Is there a path in $G$ from $u$ to $v$? <br/>&#xA;Can we say t...
complexity theory graphs np complete hamiltonian path
1
Relation between digraph and NP-Complete problem -- (complexity theory graphs np complete hamiltonian path) <p>Can there be any relations regarding the number of nodes available in a digraph so that to qualify it as NP-Complete problem. &#xA;If we consider this problem for instance:<br/>&#xA;Input: A digraph $G=(V,E)$ ...
habedi/stack-exchange-dataset
22,589
Why does a processor have 32 registers?
<p>I've always wondered why processors stopped at 32 registers. It's by far the fastest piece of the machine, why not just make bigger processors with more registers? Wouldn't that mean less going to the RAM?</p>&#xA;
computer architecture
1
Why does a processor have 32 registers? -- (computer architecture) <p>I've always wondered why processors stopped at 32 registers. It's by far the fastest piece of the machine, why not just make bigger processors with more registers? Wouldn't that mean less going to the RAM?</p>&#xA;
habedi/stack-exchange-dataset
22,594
Left recursion for LL(1)
<p>Hi I am trying to solve a LL(1) form question for first n follow rule The question is</p>&#xA;&#xA;<pre><code>A::=BC|C&#xA;B::=Bd|ef&#xA;C::=gh|j&#xA;</code></pre>&#xA;&#xA;<p>What I have done to eliminate left recursion </p>&#xA;&#xA;<pre><code>A::=CA’&#xA;A’::=CB’&#xA;A’::=ϵ&#xA;B::=efB’&#xA;B::=dB’&#xA;B’::=ϵ&#xA...
formal languages parsing left recursion
1
Left recursion for LL(1) -- (formal languages parsing left recursion) <p>Hi I am trying to solve a LL(1) form question for first n follow rule The question is</p>&#xA;&#xA;<pre><code>A::=BC|C&#xA;B::=Bd|ef&#xA;C::=gh|j&#xA;</code></pre>&#xA;&#xA;<p>What I have done to eliminate left recursion </p>&#xA;&#xA;<pre><code>A...
habedi/stack-exchange-dataset
22,596
Mathematical Induction Problem from Concrete Abstractions
<p>This is a problem from 'Concrete Abstractions' which is available free on the web[1]. It's a book similar to SICP. The problem:</p>&#xA;&#xA;<blockquote>&#xA; <p>Exercise 2.16&#xA; Consider the following procedure foo:</p>&#xA;</blockquote>&#xA;&#xA;<pre><code>(define foo&#xA; (lambda (x n)&#xA; (if (= n 0)...
induction lisp
1
Mathematical Induction Problem from Concrete Abstractions -- (induction lisp) <p>This is a problem from 'Concrete Abstractions' which is available free on the web[1]. It's a book similar to SICP. The problem:</p>&#xA;&#xA;<blockquote>&#xA; <p>Exercise 2.16&#xA; Consider the following procedure foo:</p>&#xA;</block...
habedi/stack-exchange-dataset
22,611
Examples of algorithms that have runtime O(N + M) resp O(NM)
<p>I'm looking for examples of loops that have running time $O(nm)$, $O(n+m)$ and $O(n\log m)$ to help me understand these concepts. Could anybody give some examples and explain why they have the given running time?</p>&#xA;
algorithms algorithm analysis asymptotics
1
Examples of algorithms that have runtime O(N + M) resp O(NM) -- (algorithms algorithm analysis asymptotics) <p>I'm looking for examples of loops that have running time $O(nm)$, $O(n+m)$ and $O(n\log m)$ to help me understand these concepts. Could anybody give some examples and explain why they have the given running t...
habedi/stack-exchange-dataset
22,615
What's the time complexity of this append method?
<p>I made a method that appends a sequence to another sequence.</p>&#xA;&#xA;<p>So: (append [1,2,3] [4,5,6]) = [1,2,3,4,5,6]</p>&#xA;&#xA;<p><strong>CODE In C#</strong></p>&#xA;&#xA;<pre><code>IEnumerable&lt;int&gt; Append(IEnumerable&lt;int&gt; xs,IEnumerable&lt;int&gt; ys)&#xA;{&#xA; using(var iteratorX = xs.GetEn...
algorithms algorithm analysis time complexity runtime analysis
1
What's the time complexity of this append method? -- (algorithms algorithm analysis time complexity runtime analysis) <p>I made a method that appends a sequence to another sequence.</p>&#xA;&#xA;<p>So: (append [1,2,3] [4,5,6]) = [1,2,3,4,5,6]</p>&#xA;&#xA;<p><strong>CODE In C#</strong></p>&#xA;&#xA;<pre><code>IEnumerab...
habedi/stack-exchange-dataset
22,652
How to tell which value belongs to the key during hashing
<p>To prevent collisions in Hash table , <a href="http://en.wikipedia.org/wiki/Hash_table#Collision_resolution" rel="nofollow">seperate chaining with linked list</a> is used . Hash table works by hashing the key and storing the value in the bucket. </p>&#xA;&#xA;<p>Assuming 4 keys hash to the same bucket , and the buck...
hash tables linked lists
1
How to tell which value belongs to the key during hashing -- (hash tables linked lists) <p>To prevent collisions in Hash table , <a href="http://en.wikipedia.org/wiki/Hash_table#Collision_resolution" rel="nofollow">seperate chaining with linked list</a> is used . Hash table works by hashing the key and storing the valu...
habedi/stack-exchange-dataset
22,656
How many times can you divide a list of n elements in 1/2
<p>I am trying to wrap my head around recursion and divide and conquer algorithms. Can someone provide a proof and explanation of how many times a list of n elements can be divided in 1/2 on both sides.. In other words the total number of half divisions in a recursive divide procedure on a list of size n. </p>&#xA;
recurrence relation recursion divide and conquer
1
How many times can you divide a list of n elements in 1/2 -- (recurrence relation recursion divide and conquer) <p>I am trying to wrap my head around recursion and divide and conquer algorithms. Can someone provide a proof and explanation of how many times a list of n elements can be divided in 1/2 on both sides.. In o...
habedi/stack-exchange-dataset
22,657
Solve the recurrence $f(n+1)=f(n)^2,\, f(0)=2$
<p>I have a problem with an exercise asking me to solve the following recurrence:&#xA;$$f(n+1)=f(n)^2, \quad f(0)=2$$&#xA;Can someone explain how to solve this? I tried but couldn't.</p>&#xA;
algorithms recurrence relation
1
Solve the recurrence $f(n+1)=f(n)^2,\, f(0)=2$ -- (algorithms recurrence relation) <p>I have a problem with an exercise asking me to solve the following recurrence:&#xA;$$f(n+1)=f(n)^2, \quad f(0)=2$$&#xA;Can someone explain how to solve this? I tried but couldn't.</p>&#xA;
habedi/stack-exchange-dataset
22,662
Why does merge sort run in $O(n^2)$ time?
<p>I have been learning about Big O, Big Omega, and Big Theta. I have been reading many SO questions and answers to get a better understanding of the notations. From my understanding, it seems that <strong>Big O is the upper bound</strong> running time/space of the algorithm, <strong>Big Omega is the lower bound</stron...
algorithms terminology asymptotics landau notation
1
Why does merge sort run in $O(n^2)$ time? -- (algorithms terminology asymptotics landau notation) <p>I have been learning about Big O, Big Omega, and Big Theta. I have been reading many SO questions and answers to get a better understanding of the notations. From my understanding, it seems that <strong>Big O is the upp...
habedi/stack-exchange-dataset
22,675
Solve recurrence
<p>![enter image description here][1]</p>&#xA;&#xA;<p>I have a problem to solve this recurrence. I tried by myself but it doesn't look understandable. Solve the following recurrence</p>&#xA;
algorithms recurrence relation
1
Solve recurrence -- (algorithms recurrence relation) <p>![enter image description here][1]</p>&#xA;&#xA;<p>I have a problem to solve this recurrence. I tried by myself but it doesn't look understandable. Solve the following recurrence</p>&#xA;
habedi/stack-exchange-dataset
22,676
Language with $\log\log n$ space complexity?
<p>We know that every non-regular language can be recognized with $ \Omega&#xA; (\log\log n) $ space complexity.</p>&#xA;&#xA;<p>I'm looking for an example of a language which is $ \Theta&#xA; (\log\log n) $ space complexity (if such exists).</p>&#xA;
formal languages space complexity
1
Language with $\log\log n$ space complexity? -- (formal languages space complexity) <p>We know that every non-regular language can be recognized with $ \Omega&#xA; (\log\log n) $ space complexity.</p>&#xA;&#xA;<p>I'm looking for an example of a language which is $ \Theta&#xA; (\log\log n) $ space complexity (if such ex...
habedi/stack-exchange-dataset
22,682
Horn clause to Prolog
<p>At the needs of my HW at uni I need to transform some Horn clauses to Prolog but I cannot figure out how to do it. I found out some guides but they describe how to do it with only one fact. So can you give me a brief example on how to do it?</p>&#xA;&#xA;<p>Eg John is beautiful and rich </p>&#xA;&#xA;<p>we can trans...
first order logic prolog
1
Horn clause to Prolog -- (first order logic prolog) <p>At the needs of my HW at uni I need to transform some Horn clauses to Prolog but I cannot figure out how to do it. I found out some guides but they describe how to do it with only one fact. So can you give me a brief example on how to do it?</p>&#xA;&#xA;<p>Eg John...
habedi/stack-exchange-dataset
22,684
What is a fixed point in the context of Roger's fixed-point theorem?
<p>In the <a href="http://en.wikipedia.org/wiki/Kleene%27s_recursion_theorem#Rogers.27_fixed-point_theorem" rel="nofollow">Wikipedia article on Rogers' theorem</a>, it is stated that all total computable functions have a fixed point. The notation is a little hard for me to understand; a symbol is used that is used to ...
computability
1
What is a fixed point in the context of Roger's fixed-point theorem? -- (computability) <p>In the <a href="http://en.wikipedia.org/wiki/Kleene%27s_recursion_theorem#Rogers.27_fixed-point_theorem" rel="nofollow">Wikipedia article on Rogers' theorem</a>, it is stated that all total computable functions have a fixed point...
habedi/stack-exchange-dataset
22,722
How do I choose an optimal cell size when searching for close pairs of points, and using cells to implement this?
<p>Suppose that I have a set of $N$ points in $k$-dimensional space ($k&gt;1$), such as in <a href="https://cs.stackexchange.com/q/22693/15794">this question</a>, and that I need to find all pairs with a distance¹ smaller than a certain threshold $t$. The brute-force method would require $N(N-1)$ distance calculations...
algorithms computational geometry matching
1
How do I choose an optimal cell size when searching for close pairs of points, and using cells to implement this? -- (algorithms computational geometry matching) <p>Suppose that I have a set of $N$ points in $k$-dimensional space ($k&gt;1$), such as in <a href="https://cs.stackexchange.com/q/22693/15794">this question<...
habedi/stack-exchange-dataset
22,725
Merge-by-weight to solve reachability problems in trees and DAGs
<p>Let $T = (V, E)$ be a tree with a designated root $r \in V$. The fact that the tree is rooted allows us to speak of "subtrees of $T$ rooted at some node $x \in V$". Let's say we have a (not necessarily injective) function $c: V \rightarrow \mathbb{N}$ that assigns a color to every node. </p>&#xA;&#xA;<p>We want to f...
graphs trees
1
Merge-by-weight to solve reachability problems in trees and DAGs -- (graphs trees) <p>Let $T = (V, E)$ be a tree with a designated root $r \in V$. The fact that the tree is rooted allows us to speak of "subtrees of $T$ rooted at some node $x \in V$". Let's say we have a (not necessarily injective) function $c: V \right...
habedi/stack-exchange-dataset
22,727
Proving a language is not a regular language but a context free language
<p>I have the languages $L_1$ and $L_2$ such that $L_1 = \{a^nba^n :n \in N\}$ and $L_2 =\{a,b\}^*\setminus L_1$.</p>&#xA;&#xA;<p>I want to prove that $L_2$ is not a regular language. I know that to prove that $L_2$ is not a regular language I can use the pumping lemma but I'm unsure about the details.</p>&#xA;&#xA;<p>...
formal languages regular languages context free pushdown automata
1
Proving a language is not a regular language but a context free language -- (formal languages regular languages context free pushdown automata) <p>I have the languages $L_1$ and $L_2$ such that $L_1 = \{a^nba^n :n \in N\}$ and $L_2 =\{a,b\}^*\setminus L_1$.</p>&#xA;&#xA;<p>I want to prove that $L_2$ is not a regular la...
habedi/stack-exchange-dataset
22,729
Defining a context-free grammar for $\{w \in \{0, 1\}^* : \#_0(w) = \#_1(w)\}$
<p>I have a language where each string in the language has even amount of $0$'s as $1$'s (e.g., $0101$, $1010$, $1100$, $0011$, $10$ are all in the language). I was hoping to define a context-free grammar that describes this language. After defining a context-free grammar I want to formally prove that this context-free...
formal languages context free formal grammars
1
Defining a context-free grammar for $\{w \in \{0, 1\}^* : \#_0(w) = \#_1(w)\}$ -- (formal languages context free formal grammars) <p>I have a language where each string in the language has even amount of $0$'s as $1$'s (e.g., $0101$, $1010$, $1100$, $0011$, $10$ are all in the language). I was hoping to define a contex...
habedi/stack-exchange-dataset
22,735
Sandwiching Languages
<p>I am studying for my algorithms final and came across the following problem:</p>&#xA;&#xA;<p>Find three languages $L_1 \subset L_2 \subset L_3$ over the same alphabet such that $L_2 \in P$ and $L_1,L_3$ are undecidable.</p>&#xA;&#xA;<p>I am having trouble coming up with an example of three such languages. My first t...
formal languages computability undecidability
1
Sandwiching Languages -- (formal languages computability undecidability) <p>I am studying for my algorithms final and came across the following problem:</p>&#xA;&#xA;<p>Find three languages $L_1 \subset L_2 \subset L_3$ over the same alphabet such that $L_2 \in P$ and $L_1,L_3$ are undecidable.</p>&#xA;&#xA;<p>I am hav...
habedi/stack-exchange-dataset
22,739
Subgraph Isomophism Problem - Color Coding Technique - Proof Sketch
<p>I am reading the paper Color Coding by Alon, Yuster, and Zwick. They state a theorem (6.3) that says if $H$ is a graph on $k$ vertices with treewidth $t$ and $G = (V, E)$, then a subgraph of $G$ isomorphic to $H$ can be found in $2^{O(k)}V^{t+1}$ expected time. They do not include a proof, but do state that the proo...
graphs graph isomorphism
1
Subgraph Isomophism Problem - Color Coding Technique - Proof Sketch -- (graphs graph isomorphism) <p>I am reading the paper Color Coding by Alon, Yuster, and Zwick. They state a theorem (6.3) that says if $H$ is a graph on $k$ vertices with treewidth $t$ and $G = (V, E)$, then a subgraph of $G$ isomorphic to $H$ can be...
habedi/stack-exchange-dataset
22,741
How to Study Space Complexity
<p>I am working through Sipser, and I am trying to understand some of the algorithms described in Space Complexity, but I am having a hard time understanding the presentation of the material (especially Savitch's theorem). I have a very strong intuition for time complexity, but I don't understand how space complexity f...
turing machines space complexity
1
How to Study Space Complexity -- (turing machines space complexity) <p>I am working through Sipser, and I am trying to understand some of the algorithms described in Space Complexity, but I am having a hard time understanding the presentation of the material (especially Savitch's theorem). I have a very strong intuitio...
habedi/stack-exchange-dataset
22,742
Limits to the definition of a language
<p>Is there any limit to what we can define as a language? Is any set of symbols a language?</p>&#xA;&#xA;<p>For example, given the alphabet $\Sigma$, do we say that the language $L = \Sigma$ has alphabet $\Sigma$?</p>&#xA;&#xA;<p>Also, what is the intuitive modern equivalent to languages (as defined WRT complexity cla...
formal languages terminology
1
Limits to the definition of a language -- (formal languages terminology) <p>Is there any limit to what we can define as a language? Is any set of symbols a language?</p>&#xA;&#xA;<p>For example, given the alphabet $\Sigma$, do we say that the language $L = \Sigma$ has alphabet $\Sigma$?</p>&#xA;&#xA;<p>Also, what is th...
habedi/stack-exchange-dataset
22,753
Does the OS create its own bootstrapped stack frame when running a program?
<p>I've been doing nand2tetris exercises and I'm quite interested in how compilation actually works. In nand2tetris when creating the VM language I had to create a "bootstrap" which called the main method of the program.</p>&#xA;&#xA;<p>In other languages such as C, Java or even interpreted languages like PHP, does the...
operating systems compilers stacks
1
Does the OS create its own bootstrapped stack frame when running a program? -- (operating systems compilers stacks) <p>I've been doing nand2tetris exercises and I'm quite interested in how compilation actually works. In nand2tetris when creating the VM language I had to create a "bootstrap" which called the main method...
habedi/stack-exchange-dataset
22,754
Characterisation of graphs that are not 3-colorable
<p>We know that <em>all</em> graphs with odd cycles (odd number of vertices) are not 2-colorable. Is there a similar characterisation for 3-colorability? I am looking for undirected graphs that are not 3-colorable depending on a single graph property e.g. vertices/edges parity or anything else that can be generalised.<...
graphs colorings
1
Characterisation of graphs that are not 3-colorable -- (graphs colorings) <p>We know that <em>all</em> graphs with odd cycles (odd number of vertices) are not 2-colorable. Is there a similar characterisation for 3-colorability? I am looking for undirected graphs that are not 3-colorable depending on a single graph prop...
habedi/stack-exchange-dataset
22,759
Complement DCFGs and handles
<p>If I have a DCFG G for some language over {0,1}* and a DCFG H for its complement, with disjoint non-terminals, and a (perhaps partially reduced) string, can they both have a handle for the string? So the right hand sides of these rules would consist of only terminals and one would be a (maybe proper) prefix of the o...
context free formal grammars
1
Complement DCFGs and handles -- (context free formal grammars) <p>If I have a DCFG G for some language over {0,1}* and a DCFG H for its complement, with disjoint non-terminals, and a (perhaps partially reduced) string, can they both have a handle for the string? So the right hand sides of these rules would consist of o...
habedi/stack-exchange-dataset
22,764
On Shannon Capacity
<p>Let $G$ be a graph whose Shannon Capacity is $\Theta(G)$. Is there any graph product for which the Shannon Capacity is $\Theta(G)^k$ where $k$ is the number of times the product is taken?</p>&#xA;
graphs information theory
1
On Shannon Capacity -- (graphs information theory) <p>Let $G$ be a graph whose Shannon Capacity is $\Theta(G)$. Is there any graph product for which the Shannon Capacity is $\Theta(G)^k$ where $k$ is the number of times the product is taken?</p>&#xA;
habedi/stack-exchange-dataset
22,767
Choosing a subset to maximize the minimum distance between points
<p>I have a set of points $C$, and I have the distance between each point $D(P_i,P_j)$. These distances are euclidean but the points are actually in a feature space.</p>&#xA;&#xA;<p>From the $C$ points I want to choose a subset of $n$ points. Call this subset $s$. I want to choose this subset so as to maximize the mini...
optimization
1
Choosing a subset to maximize the minimum distance between points -- (optimization) <p>I have a set of points $C$, and I have the distance between each point $D(P_i,P_j)$. These distances are euclidean but the points are actually in a feature space.</p>&#xA;&#xA;<p>From the $C$ points I want to choose a subset of $n$ p...
habedi/stack-exchange-dataset
22,769
P, NP and polynomial time reduction?
<p>If $P = NP$ would this imply that polynomial time reduction from an $NP$- to a $P$-problem would be possible? And if $P\neq NP$ does it imply that a polynomial time reduction from an $NP$- to a $P$-problem would be impossible?</p>&#xA;
complexity theory np complete reductions
1
P, NP and polynomial time reduction? -- (complexity theory np complete reductions) <p>If $P = NP$ would this imply that polynomial time reduction from an $NP$- to a $P$-problem would be possible? And if $P\neq NP$ does it imply that a polynomial time reduction from an $NP$- to a $P$-problem would be impossible?</p>&#xA...
habedi/stack-exchange-dataset
22,772
If neither $L_1$ nor $L_2$ are context free then is $L_1 \cup L_2$ also not a context free language?
<p>If two regular languages $L_1$ and $L_2$ are both <strong>not</strong> context free languages then is $L_1 \cup L_2$ also <strong>not</strong> a context free?</p>&#xA;&#xA;<p>I am aware that if $L_1$ and $L_2$ are context free languages then the language $L_1 \cap L_2$ is also context free but cannot quite connect t...
formal languages regular languages context free
1
If neither $L_1$ nor $L_2$ are context free then is $L_1 \cup L_2$ also not a context free language? -- (formal languages regular languages context free) <p>If two regular languages $L_1$ and $L_2$ are both <strong>not</strong> context free languages then is $L_1 \cup L_2$ also <strong>not</strong> a context free?</p>&...
habedi/stack-exchange-dataset
22,781
Similarity between two geometric shapes
<p>I have two shapes in a 2D space, not necessarily convex, and I'd like to compare how similar they are. How can I define a robust distance metric to measure their similarity, and how can I compute it?</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/COt2d.png" alt="Distance between two shapes"></p>&#xA;&#xA;<p>I a...
algorithms graphs computational geometry computer vision
1
Similarity between two geometric shapes -- (algorithms graphs computational geometry computer vision) <p>I have two shapes in a 2D space, not necessarily convex, and I'd like to compare how similar they are. How can I define a robust distance metric to measure their similarity, and how can I compute it?</p>&#xA;&#xA;<p...
habedi/stack-exchange-dataset
22,791
Verify the type of a lambda expression
<p>I need to verify the type for the lambda expression: $\lambda f.\lambda x.f (f x)$</p>&#xA;&#xA;<p>My method gives me: $(a\rightarrow c)\rightarrow b\rightarrow c$</p>&#xA;&#xA;<p>Im trying to define it in Haskell (on Hugs) like this: </p>&#xA;&#xA;<pre><code>h= \f x -&gt; f (f x)&#xA;</code></pre>&#xA;&#xA;<p>When ...
lambda calculus type theory
1
Verify the type of a lambda expression -- (lambda calculus type theory) <p>I need to verify the type for the lambda expression: $\lambda f.\lambda x.f (f x)$</p>&#xA;&#xA;<p>My method gives me: $(a\rightarrow c)\rightarrow b\rightarrow c$</p>&#xA;&#xA;<p>Im trying to define it in Haskell (on Hugs) like this: </p>&#xA;&...
habedi/stack-exchange-dataset
22,792
what are the basic/typical/common mistakes in P=NP claims?
<p>the P vs NP problem attracts a lot of attention, not all of it desirable, for a wide variety of reasons. there are many P=NP claims eg on this widely cited list maintained by mathematician Woegeorgi, <a href="http://www.win.tue.nl/~gwoegi/P-versus-NP.htm" rel="nofollow noreferrer">P vs NP page</a>. also, intermitten...
complexity theory p vs np
1
what are the basic/typical/common mistakes in P=NP claims? -- (complexity theory p vs np) <p>the P vs NP problem attracts a lot of attention, not all of it desirable, for a wide variety of reasons. there are many P=NP claims eg on this widely cited list maintained by mathematician Woegeorgi, <a href="http://www.win.tue...
habedi/stack-exchange-dataset
22,797
Heterogenous and Asymmetric Computing's differences
<p>The definition of the both architecture looks pretty same. They are parallel computing architecture with different type of cores. </p>&#xA;&#xA;<p>What distinguish their definition, actually?</p>&#xA;
terminology computer architecture parallel computing
1
Heterogenous and Asymmetric Computing's differences -- (terminology computer architecture parallel computing) <p>The definition of the both architecture looks pretty same. They are parallel computing architecture with different type of cores. </p>&#xA;&#xA;<p>What distinguish their definition, actually?</p>&#xA;
habedi/stack-exchange-dataset
22,801
Print bottom view of a binary tree
<p>For a binary tree we define horizontal distance as follows:</p>&#xA;&#xA;<pre><code> Horizontal distance(hd) of root = 0&#xA; If you go left then hd = hd(of its parent)-1, and &#xA; if you go right then hd = hd(of its parent)+1.&#xA;</code></pre>&#xA;&#xA;<p>The bottom view of a tree then consists of all th...
algorithms binary trees
1
Print bottom view of a binary tree -- (algorithms binary trees) <p>For a binary tree we define horizontal distance as follows:</p>&#xA;&#xA;<pre><code> Horizontal distance(hd) of root = 0&#xA; If you go left then hd = hd(of its parent)-1, and &#xA; if you go right then hd = hd(of its parent)+1.&#xA;</code></pr...
habedi/stack-exchange-dataset
22,814
Is it possible for a language and its complement to both be unrecognizable?
<p>Given some unrecognizable language $L$, is it possible for its complement $\overline{L}$ to also be unrecognizable?</p>&#xA;&#xA;<p>If some other language $S$ and its complement $\overline{S}$ are both recognizable, then $S$ and $\overline{S}$ are decidable. If $\overline{S}$ is unrecognizable, then then $S$ is unde...
computability semi decidability
1
Is it possible for a language and its complement to both be unrecognizable? -- (computability semi decidability) <p>Given some unrecognizable language $L$, is it possible for its complement $\overline{L}$ to also be unrecognizable?</p>&#xA;&#xA;<p>If some other language $S$ and its complement $\overline{S}$ are both re...
habedi/stack-exchange-dataset
22,817
Prim's Minimum Spanning Tree implementation $O(mn)$ or $O(m+n \log n)$?
<p>I am reading Prim's MST for the first time and wanted to implement the fast version of it . </p>&#xA;&#xA;<p>$m$ - The number of edges in the graph </p>&#xA;&#xA;<p>$n$ - The number of vertices in the graph </p>&#xA;&#xA;<p>Here's the algorithm :</p>&#xA;&#xA;<p>1) Create a Min Heap of size $V$ where $V$ is the numb...
algorithms graphs algorithm analysis runtime analysis
1
Prim's Minimum Spanning Tree implementation $O(mn)$ or $O(m+n \log n)$? -- (algorithms graphs algorithm analysis runtime analysis) <p>I am reading Prim's MST for the first time and wanted to implement the fast version of it . </p>&#xA;&#xA;<p>$m$ - The number of edges in the graph </p>&#xA;&#xA;<p>$n$ - The number of v...
habedi/stack-exchange-dataset
22,821
Why does x86 has explicit register definitions, and RISC's doesn't?
<p>For example, on x86, we have a set of general registers, each named to the function it carries out. </p>&#xA;&#xA;<p>We have an Accumulator, which is a storage for a results of different fixed point operations, we have a Base register, which is used for addressing elements in the array, a Cycle register, which holds...
computer architecture
1
Why does x86 has explicit register definitions, and RISC's doesn't? -- (computer architecture) <p>For example, on x86, we have a set of general registers, each named to the function it carries out. </p>&#xA;&#xA;<p>We have an Accumulator, which is a storage for a results of different fixed point operations, we have a B...
habedi/stack-exchange-dataset
22,823
Calculating time complexity of two interdependent nested for loops
<p>Consider the following code segment :</p>&#xA;&#xA;<pre><code>for (int i = 1; i &lt;= n; i++ ) {&#xA; for (int j = 1; j &lt;= n; j = j + i ) {&#xA; printf("Hi");&#xA; }&#xA;}&#xA;</code></pre>&#xA;&#xA;<p>Here, the outer loop will execute $ n $ times, but the execution of inner loop depends upon the v...
algorithm analysis runtime analysis loops
1
Calculating time complexity of two interdependent nested for loops -- (algorithm analysis runtime analysis loops) <p>Consider the following code segment :</p>&#xA;&#xA;<pre><code>for (int i = 1; i &lt;= n; i++ ) {&#xA; for (int j = 1; j &lt;= n; j = j + i ) {&#xA; printf("Hi");&#xA; }&#xA;}&#xA;</code></...
habedi/stack-exchange-dataset
22,826
Log-Space Reduction $CO-2Col \le_L USTCON$
<p>I want to show that $CO-2Col \le_L USTCON$ (Log-Space reduction)</p>&#xA;&#xA;<h2>$USTCON$</h2>&#xA;&#xA;<blockquote>&#xA; <p>The $s-t$ connectivity problem for <strong>undirected</strong> graphs is&#xA; called $USTCON$.</p>&#xA; &#xA; <p>[Input]: An undirected graph $G=(V,E)$, $s,t \in V$.</p>&#xA; &#xA; <p>[...
complexity theory reductions space complexity
1
Log-Space Reduction $CO-2Col \le_L USTCON$ -- (complexity theory reductions space complexity) <p>I want to show that $CO-2Col \le_L USTCON$ (Log-Space reduction)</p>&#xA;&#xA;<h2>$USTCON$</h2>&#xA;&#xA;<blockquote>&#xA; <p>The $s-t$ connectivity problem for <strong>undirected</strong> graphs is&#xA; called $USTCON$.<...
habedi/stack-exchange-dataset
22,832
Construct context free grammar from language
<p>I have been starting to learn about CFGs and PDAs and have gotten familiar with the simple stuff. I have been able to construct CFGs for simple languages but this question is more specific:</p>&#xA;&#xA;<p>$\lbrace 0^a1^b2^c3^d4^e5^f |a,b,c,d,e,f \geq 0$ and $a+b=d+e\rbrace$.</p>&#xA;&#xA;<p>My thought process has o...
formal languages context free formal grammars
1
Construct context free grammar from language -- (formal languages context free formal grammars) <p>I have been starting to learn about CFGs and PDAs and have gotten familiar with the simple stuff. I have been able to construct CFGs for simple languages but this question is more specific:</p>&#xA;&#xA;<p>$\lbrace 0^a1^b...
habedi/stack-exchange-dataset
22,834
Proving that context-free languages are closed under inserting symbols
<p>This is a theoretical computer science question, regarding the proof of whether or not context-free languages are closed under an operation. This means basically that any context-free language which undergoes this operation would still be context-free.</p>&#xA;&#xA;<blockquote>&#xA; <p>For a language $A$ which is ...
formal languages context free closure properties
1
Proving that context-free languages are closed under inserting symbols -- (formal languages context free closure properties) <p>This is a theoretical computer science question, regarding the proof of whether or not context-free languages are closed under an operation. This means basically that any context-free languag...
habedi/stack-exchange-dataset
22,839
how do I find a undecidable subset of a set that's decidable?
<p>Given that Let S = {a | |a| is odd}. I know that since S is decidable, but does there exist a subset within S that is undecidable?</p>&#xA;
turing machines undecidability
1
how do I find a undecidable subset of a set that's decidable? -- (turing machines undecidability) <p>Given that Let S = {a | |a| is odd}. I know that since S is decidable, but does there exist a subset within S that is undecidable?</p>&#xA;
habedi/stack-exchange-dataset
22,846
Develop the context free grammar to match this language (puzzle)
<p>This is a puzzle type question which asks to create a context-free grammar to match this language:</p>&#xA;&#xA;<pre><code>{ x#w | x,w are in {a,b}*, and w contains the reversal of x as a substring }&#xA;</code></pre>&#xA;&#xA;<p>So some example strings to try:&#xA; #, a#a, b#b, ab#ba, ab#aaabbba</p>&#xA;&#xA;<p>...
context free
1
Develop the context free grammar to match this language (puzzle) -- (context free) <p>This is a puzzle type question which asks to create a context-free grammar to match this language:</p>&#xA;&#xA;<pre><code>{ x#w | x,w are in {a,b}*, and w contains the reversal of x as a substring }&#xA;</code></pre>&#xA;&#xA;<p>So s...
habedi/stack-exchange-dataset
22,849
Why is there a 2n+1 comparison for a linear search algorithm?
<p>Suppose an algorithm goes through a list of n integers and for every iteration of the loop it is needs to check if the current evaluated element of the list is even. If it is even, return the index of the integer that is evaluated as even.</p>&#xA;&#xA;<p>How come the algorithm would have 2n+1 comparison?</p>&#xA;&#...
algorithms algorithm analysis runtime analysis
1
Why is there a 2n+1 comparison for a linear search algorithm? -- (algorithms algorithm analysis runtime analysis) <p>Suppose an algorithm goes through a list of n integers and for every iteration of the loop it is needs to check if the current evaluated element of the list is even. If it is even, return the index of th...
habedi/stack-exchange-dataset
22,850
Is $L = \{ x \in \{ 0, 1 \}^* : |x| = 2^n $ for some natural number n $\}$ context free?
<p>I was wondering if this language is context-free:</p>&#xA;&#xA;<p>$L = \{ x \in \{ 0, 1 \}^* : |x| = 2^n $ for some natural number n $\}$ </p>&#xA;&#xA;<p>I know that this language is not regular because it fails the pumping lemma for regular languages but that does not necessarily mean it is not context-free. I'm n...
formal languages regular languages context free
1
Is $L = \{ x \in \{ 0, 1 \}^* : |x| = 2^n $ for some natural number n $\}$ context free? -- (formal languages regular languages context free) <p>I was wondering if this language is context-free:</p>&#xA;&#xA;<p>$L = \{ x \in \{ 0, 1 \}^* : |x| = 2^n $ for some natural number n $\}$ </p>&#xA;&#xA;<p>I know that this lan...
habedi/stack-exchange-dataset
22,863
Turing machine - infinite tape in one or two directions
<p>I have seen turing machines beeing represented with tapes infinite in one, and in two directions. Is there any difference in the power of such turing machines, or are they basically equivalent? In my head I think they are equivalent, since I guess that there must be some way to represent the two-way infinite tape as...
turing machines
1
Turing machine - infinite tape in one or two directions -- (turing machines) <p>I have seen turing machines beeing represented with tapes infinite in one, and in two directions. Is there any difference in the power of such turing machines, or are they basically equivalent? In my head I think they are equivalent, since ...
habedi/stack-exchange-dataset
22,869
How to make this recursive relationship nonrecursive?
<p>I need to make a recursive relationship for a function <code>f(m, n)</code> nonrecursive to make it more efficient and succinct in my code.</p>&#xA;&#xA;<p>I stumbled across an important recurrence relationship dealing with the number of vertices, edges, faces, and solids (<a href="http://en.wikipedia.org/wiki/Polyt...
algorithms combinatorics computational geometry recurrence relation
1
How to make this recursive relationship nonrecursive? -- (algorithms combinatorics computational geometry recurrence relation) <p>I need to make a recursive relationship for a function <code>f(m, n)</code> nonrecursive to make it more efficient and succinct in my code.</p>&#xA;&#xA;<p>I stumbled across an important rec...
habedi/stack-exchange-dataset
22,872
What kind of model is used by 20 Questions?
<p>Which kind of machine learning concept / model is used in <a href="http://www.20q.net" rel="nofollow">20 Questions</a>?<br>&#xA;Is this kind of thing best solved by a neural network?<br>&#xA;Where I can read something about it?</p>&#xA;
machine learning neural networks data mining
1
What kind of model is used by 20 Questions? -- (machine learning neural networks data mining) <p>Which kind of machine learning concept / model is used in <a href="http://www.20q.net" rel="nofollow">20 Questions</a>?<br>&#xA;Is this kind of thing best solved by a neural network?<br>&#xA;Where I can read something about...
habedi/stack-exchange-dataset
22,877
Bankers algorithm - How does it work?
<p>I'm currently studying deadlocks and I'm trying to learn myself the bankers algorithm.</p>&#xA;<p>In this example my teacher goes to B first, then C and finally A.</p>&#xA;<p>He adds (I think) 2 (row b, Has) with 3 (free) and then gets the new Free value 5.&#xA;After that he proceeds to row C where he adds 2 (row c,...
algorithms deadlocks
1
Bankers algorithm - How does it work? -- (algorithms deadlocks) <p>I'm currently studying deadlocks and I'm trying to learn myself the bankers algorithm.</p>&#xA;<p>In this example my teacher goes to B first, then C and finally A.</p>&#xA;<p>He adds (I think) 2 (row b, Has) with 3 (free) and then gets the new Free valu...
habedi/stack-exchange-dataset
22,880
Can a context free grammar for $L$, generate a string not in $L$?
<p>from Sipster's definition: Any language that can be generated by some context-free grammar (call it $G$) is called a context-free language (CFL). However, can $G$ generate strings that are not in the the language that recognizes $G$?</p>&#xA;
terminology context free formal grammars
1
Can a context free grammar for $L$, generate a string not in $L$? -- (terminology context free formal grammars) <p>from Sipster's definition: Any language that can be generated by some context-free grammar (call it $G$) is called a context-free language (CFL). However, can $G$ generate strings that are not in the the l...
habedi/stack-exchange-dataset
22,884
Proving a language is context free by coming up with a context free grammar for the language
<p>Let A and B be languages over $\sum$ = {0, 1, 2, 3}</p>&#xA;&#xA;<p>Language A = {$(0U1)^a(1U2)^b(2U3)^c | a \geq b$}</p>&#xA;&#xA;<p>Language B = {$(0U1)^a(1U2)^b(2U3)^c | a = c$}</p>&#xA;&#xA;<p>Question: prove that A and B are context free</p>&#xA;
computation models
1
Proving a language is context free by coming up with a context free grammar for the language -- (computation models) <p>Let A and B be languages over $\sum$ = {0, 1, 2, 3}</p>&#xA;&#xA;<p>Language A = {$(0U1)^a(1U2)^b(2U3)^c | a \geq b$}</p>&#xA;&#xA;<p>Language B = {$(0U1)^a(1U2)^b(2U3)^c | a = c$}</p>&#xA;&#xA;<p>Qu...
habedi/stack-exchange-dataset
22,900
Relation between logspace-uniform circuits and P-uniform circuits
<p>In the book "Computational complexity" of Barak and Arora, on page 112, they state that:</p>&#xA;&#xA;<blockquote>&#xA; <p>Theorem 6.15: A language has logspace-uniform circuits of polynomial size iff it is in P.</p>&#xA;</blockquote>&#xA;&#xA;<p>The proof of this one is left as an exercise to the reader. I think ...
polynomial time circuits
1
Relation between logspace-uniform circuits and P-uniform circuits -- (polynomial time circuits) <p>In the book "Computational complexity" of Barak and Arora, on page 112, they state that:</p>&#xA;&#xA;<blockquote>&#xA; <p>Theorem 6.15: A language has logspace-uniform circuits of polynomial size iff it is in P.</p>&#xA...
habedi/stack-exchange-dataset
22,905
Prove that context free languages aren't closed under DropMiddle
<p>The question is simple:</p>&#xA;<blockquote>&#xA;<p><span class="math-container">$\qquad \operatorname{DropMiddle}(L)=\{xy\in\Sigma^* \mid |x|=|y| \land \exists a\in\Sigma\colon xay\in L\}$</span>.</p>&#xA;<p>Prove that CFL's aren't closed under <span class="math-container">$\operatorname{DropMiddle}$</span>.</p>&#x...
formal languages context free closure properties
1
Prove that context free languages aren't closed under DropMiddle -- (formal languages context free closure properties) <p>The question is simple:</p>&#xA;<blockquote>&#xA;<p><span class="math-container">$\qquad \operatorname{DropMiddle}(L)=\{xy\in\Sigma^* \mid |x|=|y| \land \exists a\in\Sigma\colon xay\in L\}$</span>.<...
habedi/stack-exchange-dataset
22,907
Polynomial space complexity with exponential size witnesses
<p>Define the complexity class $C$ to be the class of all languages that can be verified by a TM that has:</p>&#xA;&#xA;<ul>&#xA;<li>Input tape: Read only, move in both directions.</li>&#xA;<li>Witness tape: Read only, move only in one direction.</li>&#xA;<li>Work tape: Read-Write, move in both directions.</li>&#xA;</u...
complexity theory space complexity complexity classes
1
Polynomial space complexity with exponential size witnesses -- (complexity theory space complexity complexity classes) <p>Define the complexity class $C$ to be the class of all languages that can be verified by a TM that has:</p>&#xA;&#xA;<ul>&#xA;<li>Input tape: Read only, move in both directions.</li>&#xA;<li>Witness...
habedi/stack-exchange-dataset
22,908
O(f) vs O(f(n))
<p>I first learned about the Big O notation in an intro to Algorithms class. He showed us that function $g \in O(f(n))$ <br>&#xA;Afterwords in Discrete Math another Professor, without knowing of the first, told us that we should never do that and that it should be done as $g \in O(f)$ where g and f are functions. &#xA;...
terminology asymptotics landau notation
1
O(f) vs O(f(n)) -- (terminology asymptotics landau notation) <p>I first learned about the Big O notation in an intro to Algorithms class. He showed us that function $g \in O(f(n))$ <br>&#xA;Afterwords in Discrete Math another Professor, without knowing of the first, told us that we should never do that and that it shou...
habedi/stack-exchange-dataset
22,909
Tricky Turing Machine state diagram
<p>what would the Turing machine state diagram be for this language: &#xA;$A=\{ (0 \cup 1)^a(1 \cup 2)^b(2\cup 3)^c \mid a \geq b\} $ ?</p>&#xA;&#xA;<p>how would the turing machine design know the size of $(1 \cup 2)^b$ ? since this contains elements from the first and last parts, would it be impossible to determine? ...
turing machines computation models
1
Tricky Turing Machine state diagram -- (turing machines computation models) <p>what would the Turing machine state diagram be for this language: &#xA;$A=\{ (0 \cup 1)^a(1 \cup 2)^b(2\cup 3)^c \mid a \geq b\} $ ?</p>&#xA;&#xA;<p>how would the turing machine design know the size of $(1 \cup 2)^b$ ? since this contains e...
habedi/stack-exchange-dataset
22,910
Unification --- most specific unifier
<p>In unification, given a set of equations, a standard problem is to compute a most general unifier (mgu). I am interested in a somewhat reversed problem. Imagine having a set of equations that do not have an mgu, like this one:</p>&#xA;&#xA;<pre><code>x = a&#xA;x = b&#xA;</code></pre>&#xA;&#xA;<p><code>x</code> here ...
algorithms logic unification equality
1
Unification --- most specific unifier -- (algorithms logic unification equality) <p>In unification, given a set of equations, a standard problem is to compute a most general unifier (mgu). I am interested in a somewhat reversed problem. Imagine having a set of equations that do not have an mgu, like this one:</p>&#xA;&...
habedi/stack-exchange-dataset
22,919
Why it is said that LBA is a non deterministic Turing Machine
<p>I have read that linear bounded automaton is a Non deterministic Turing machine. Why is it so?</p>&#xA;
terminology turing machines automata nondeterminism linear bounded automata
1
Why it is said that LBA is a non deterministic Turing Machine -- (terminology turing machines automata nondeterminism linear bounded automata) <p>I have read that linear bounded automaton is a Non deterministic Turing machine. Why is it so?</p>&#xA;
habedi/stack-exchange-dataset
22,925
Why is the halting problem decidable for LBA?
<p>I have read in <a href="https://en.wikipedia.org/wiki/Halting_problem#Common_pitfalls" rel="noreferrer">Wikipedia</a> and some other texts that</p>&#xA;&#xA;<blockquote>&#xA; <p>The halting problem is [...] decidable for <a href="https://en.wikipedia.org/wiki/Linear_bounded_automaton" rel="noreferrer">linear bounde...
turing machines automata undecidability halting problem linear bounded automata
1
Why is the halting problem decidable for LBA? -- (turing machines automata undecidability halting problem linear bounded automata) <p>I have read in <a href="https://en.wikipedia.org/wiki/Halting_problem#Common_pitfalls" rel="noreferrer">Wikipedia</a> and some other texts that</p>&#xA;&#xA;<blockquote>&#xA; <p>The hal...
habedi/stack-exchange-dataset
22,929
Is the language of TMs that halt on some string recognizable?
<p>I would like to show that the following language is recognizable:&#xA;$$L:= \{ \langle M \rangle \mid M \text{ is a TM that halts on some string}\}.$$</p>&#xA;&#xA;<p>How do I go about showing that this language is recognizable? I know that all recognizable languages are reducible to $HALT_\epsilon$, so I figure if ...
computability turing machines
1
Is the language of TMs that halt on some string recognizable? -- (computability turing machines) <p>I would like to show that the following language is recognizable:&#xA;$$L:= \{ \langle M \rangle \mid M \text{ is a TM that halts on some string}\}.$$</p>&#xA;&#xA;<p>How do I go about showing that this language is recog...
habedi/stack-exchange-dataset
22,931
Generating all strings that a regular expressions describe
<p>I'm having trouble generating the set of strings, which a regular expressions describe.&#xA;A typical regular expression can look like this:</p>&#xA;&#xA;<pre><code>[atom_0] atom_1 (atom_2 | atorm_3 | ... | atom_n-1) &lt;var&gt; [atom_n]&#xA;</code></pre>&#xA;&#xA;<p>Or any other combination of the following:</p>&#x...
formal languages regular languages regular expressions
1
Generating all strings that a regular expressions describe -- (formal languages regular languages regular expressions) <p>I'm having trouble generating the set of strings, which a regular expressions describe.&#xA;A typical regular expression can look like this:</p>&#xA;&#xA;<pre><code>[atom_0] atom_1 (atom_2 | atorm_3...
habedi/stack-exchange-dataset
22,939
If I solve hard instance, therefore I prove NP=P?
<p>If someone (off-topic) asks a question (on-topic) like this:</p>&#xA;&#xA;<p>Suppose that he claims that $\mathcal{P=NP}$. Suppose that someone else (on-topic) gives him an instance of an NP-complete problem that cannot be solved by any computer optimally, i.e., to get the optimal solution, one must run an algorithm...
complexity theory p vs np
1
If I solve hard instance, therefore I prove NP=P? -- (complexity theory p vs np) <p>If someone (off-topic) asks a question (on-topic) like this:</p>&#xA;&#xA;<p>Suppose that he claims that $\mathcal{P=NP}$. Suppose that someone else (on-topic) gives him an instance of an NP-complete problem that cannot be solved by any...
habedi/stack-exchange-dataset
22,941
Is this a proper Max Heap Data Structure
<p>I was trying to understand the concept of Max-Heap. And to my understanding its a complete binary tree and each parent has a value greater than its children.The example I was going though had the following array which it said was a Max-Heap.</p>&#xA;&#xA;<pre><code>BookArray [] = {45,10,11,3,2,7,9,1,0}&#xA;</code></...
data structures binary trees heaps
1
Is this a proper Max Heap Data Structure -- (data structures binary trees heaps) <p>I was trying to understand the concept of Max-Heap. And to my understanding its a complete binary tree and each parent has a value greater than its children.The example I was going though had the following array which it said was a Max-...
habedi/stack-exchange-dataset