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
100,418
Algorithm for minimizing the number of "inversions" in a graph
<h2>Given the <strong>following graph</strong>:</h2>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/Kqp3s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kqp3s.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>With the assumptions below:</p>&#xA;&#xA;<ul>&#xA;<li>A node on the left is link...
algorithms graphs weighted graphs
1
Algorithm for minimizing the number of "inversions" in a graph -- (algorithms graphs weighted graphs) <h2>Given the <strong>following graph</strong>:</h2>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/Kqp3s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kqp3s.png" alt="enter image description here"...
habedi/stack-exchange-dataset
100,419
Handling epsilon productions in recursive descent parsing
<p>I am working on a recursive descent parser for lambda calculus. In my grammar, after removing left-recursion, I am left with the following two productions:</p>&#xA;&#xA;<pre><code># APPLICATION -&gt; ATOM APPLICATION'&#xA;# APPLICATION' -&gt; ATOM APPLICATION' | ε &#xA;</code></pre>&#xA;&#xA;<p>Both APPLICATI...
formal grammars lambda calculus recursion parsers
1
Handling epsilon productions in recursive descent parsing -- (formal grammars lambda calculus recursion parsers) <p>I am working on a recursive descent parser for lambda calculus. In my grammar, after removing left-recursion, I am left with the following two productions:</p>&#xA;&#xA;<pre><code># APPLICATION -&gt; ATO...
habedi/stack-exchange-dataset
100,439
What is the difference between "algorithm," "process" and "program"?
<p>I am currently studying algorithms and algorithmic design, and I am confused those terms. What is the difference between them?</p>&#xA;&#xA;<p>Thank you.</p>&#xA;
algorithms algorithm analysis programming languages
1
What is the difference between "algorithm," "process" and "program"? -- (algorithms algorithm analysis programming languages) <p>I am currently studying algorithms and algorithmic design, and I am confused those terms. What is the difference between them?</p>&#xA;&#xA;<p>Thank you.</p>&#xA;
habedi/stack-exchange-dataset
100,455
Subset sum problem, given that a valid subset exists
<p>I have a problem at work. I need to find a subset of a set of positive integers that sums to a certain value. I know there is a subset but I need to find it. Is this new problem the same as the subset sum problem? </p>&#xA;
algorithms complexity theory subset sum
1
Subset sum problem, given that a valid subset exists -- (algorithms complexity theory subset sum) <p>I have a problem at work. I need to find a subset of a set of positive integers that sums to a certain value. I know there is a subset but I need to find it. Is this new problem the same as the subset sum problem? </...
habedi/stack-exchange-dataset
100,464
Are Huffman codes self-synchronizing?
<p>A code is <em>(statistically) self-synchronizing</em> if, given that the transmitted string is long enough, the receiver is guaranteed to eventually synchronize with the sender, even if bit flips or slips have occurred.</p>&#xA;&#xA;<p>Do Huffman codes have this property in general? In case not, is there a criterion...
coding theory huffman coding
1
Are Huffman codes self-synchronizing? -- (coding theory huffman coding) <p>A code is <em>(statistically) self-synchronizing</em> if, given that the transmitted string is long enough, the receiver is guaranteed to eventually synchronize with the sender, even if bit flips or slips have occurred.</p>&#xA;&#xA;<p>Do Huffma...
habedi/stack-exchange-dataset
100,465
Binary trees and preallocated nodes
<p>I want to design a binary tree with preallocated nodes, in order to avoid calling malloc/free every time I want to insert/delete a node. The problem is I don't know ahead of time how many nodes the tree will have, so I am thinking I need to allocate a block of nodes at a time, then allocate another block when the fi...
binary trees linked lists stacks memory allocation
1
Binary trees and preallocated nodes -- (binary trees linked lists stacks memory allocation) <p>I want to design a binary tree with preallocated nodes, in order to avoid calling malloc/free every time I want to insert/delete a node. The problem is I don't know ahead of time how many nodes the tree will have, so I am thi...
habedi/stack-exchange-dataset
100,469
Maximum join of relations
<p>I have a question as follows </p>&#xA;&#xA;<blockquote>&#xA; <p>Consider the relations <span class="math-container">$r1(P, Q, R)$</span> and <span class="math-container">$r2(R, S, T)$</span> with primary keys <span class="math-container">$P$</span> and <span class="math-container">$R$</span> respectively. The relat...
databases
1
Maximum join of relations -- (databases) <p>I have a question as follows </p>&#xA;&#xA;<blockquote>&#xA; <p>Consider the relations <span class="math-container">$r1(P, Q, R)$</span> and <span class="math-container">$r2(R, S, T)$</span> with primary keys <span class="math-container">$P$</span> and <span class="math-cont...
habedi/stack-exchange-dataset
100,484
Counting on a matrix
<p>I have an <span class="math-container">$n \times m$</span> matrix, and fill it with numbers of <span class="math-container">$1 \dots k$</span>.</p>&#xA;&#xA;<p>If a matrix can be turned into another matrix by exchanging its lines and exchanging its columns, the two matrices are considered to be the same.</p>&#xA;&#x...
algorithms complexity theory matrices counting
1
Counting on a matrix -- (algorithms complexity theory matrices counting) <p>I have an <span class="math-container">$n \times m$</span> matrix, and fill it with numbers of <span class="math-container">$1 \dots k$</span>.</p>&#xA;&#xA;<p>If a matrix can be turned into another matrix by exchanging its lines and exchanging...
habedi/stack-exchange-dataset
100,488
How can we compute how many processes should be in memory at a time to make CPU utilization max?
<p>From the given formula, we can compute the CPU utilization:</p>&#xA;&#xA;<blockquote>&#xA; <p>CPU Utilization = 1 - P^n</p>&#xA;</blockquote>&#xA;&#xA;<p>Where p is the probability of I/O and n is the total number of processes.</p>&#xA;&#xA;<p>E.g, If we were to find CPU utilization if the computer has enough room ...
operating systems mathematical foundations
1
How can we compute how many processes should be in memory at a time to make CPU utilization max? -- (operating systems mathematical foundations) <p>From the given formula, we can compute the CPU utilization:</p>&#xA;&#xA;<blockquote>&#xA; <p>CPU Utilization = 1 - P^n</p>&#xA;</blockquote>&#xA;&#xA;<p>Where p is the pr...
habedi/stack-exchange-dataset
100,491
Sum of zero nim sum series
<p>The problem is proposed <a href="https://math.stackexchange.com/questions/3011248/sum-of-zero-sum-series">here</a> and related to <a href="https://cs.stackexchange.com/questions/100291/balls-in-bins-with-pairwise-distance">this question</a>. Given <span class="math-container">$n$</span> and <span class="math-contain...
algorithms dynamic programming combinatorics
1
Sum of zero nim sum series -- (algorithms dynamic programming combinatorics) <p>The problem is proposed <a href="https://math.stackexchange.com/questions/3011248/sum-of-zero-sum-series">here</a> and related to <a href="https://cs.stackexchange.com/questions/100291/balls-in-bins-with-pairwise-distance">this question</a>...
habedi/stack-exchange-dataset
100,521
A* Search Algorithm Implementation with Priority Queue
<p>I've got a question regarding the A* search algorithm's implementation.</p>&#xA;&#xA;<p>According to Wikipedia, one has to use a priority queue for retrieving the next node with the lowest f value, is it possible to skip to a node that is not a direct descendant of the current node? </p>&#xA;&#xA;<p>For example:<br...
algorithms search algorithms heuristics search
1
A* Search Algorithm Implementation with Priority Queue -- (algorithms search algorithms heuristics search) <p>I've got a question regarding the A* search algorithm's implementation.</p>&#xA;&#xA;<p>According to Wikipedia, one has to use a priority queue for retrieving the next node with the lowest f value, is it possib...
habedi/stack-exchange-dataset
100,532
Cache effective access time calculation
<p>In order to calculate the effective access time of a memory sub-system, I see some different approaches, a.k.a formulas. All are reasonable, but I don't know how they differ and what is the correct one.</p>&#xA;&#xA;<p>Assume a two-level cache and a main memory system with the following specs:</p>&#xA;&#xA;<pre><cod...
cpu cache memory access performance
1
Cache effective access time calculation -- (cpu cache memory access performance) <p>In order to calculate the effective access time of a memory sub-system, I see some different approaches, a.k.a formulas. All are reasonable, but I don't know how they differ and what is the correct one.</p>&#xA;&#xA;<p>Assume a two-leve...
habedi/stack-exchange-dataset
100,544
If I'm just trying to show something is NP-hard (as opposed to NP-complete) does my reduction need to be completed in polynomial time?
<p>I have a problem that I believe is NP-hard. If I reduce a NP-complete problem to it in exponential time (and not polynomial time), does that prove the problem is NP-hard?</p>&#xA;
complexity theory
1
If I'm just trying to show something is NP-hard (as opposed to NP-complete) does my reduction need to be completed in polynomial time? -- (complexity theory) <p>I have a problem that I believe is NP-hard. If I reduce a NP-complete problem to it in exponential time (and not polynomial time), does that prove the problem ...
habedi/stack-exchange-dataset
100,560
Do most computational efficiency increases due to increased transistor count in the last 70 years depend on some kind of parallelism?
<p>Modern personal computers as far as I understand have increased in power (measured informally by ability to compute “more demanding programs”) due to two “broad factors”:</p>&#xA;&#xA;<ul>&#xA;<li><p>decreased transistor size (thereby decreasing delay time between computations).</p></li>&#xA;<li><p>increased transis...
computer architecture parallel computing cpu performance
1
Do most computational efficiency increases due to increased transistor count in the last 70 years depend on some kind of parallelism? -- (computer architecture parallel computing cpu performance) <p>Modern personal computers as far as I understand have increased in power (measured informally by ability to compute “more...
habedi/stack-exchange-dataset
100,562
In which environment we use NFA(Non Deterministic Finite Automata)?
<p>We have two types of Automata. One is NFA and second is DFA. These are little bit different but thing is that in which environment we prefer NFA over the DFA?</p>&#xA;
complexity theory computability automata computer architecture regular expressions
1
In which environment we use NFA(Non Deterministic Finite Automata)? -- (complexity theory computability automata computer architecture regular expressions) <p>We have two types of Automata. One is NFA and second is DFA. These are little bit different but thing is that in which environment we prefer NFA over the DFA?</p...
habedi/stack-exchange-dataset
100,566
Given a relation and asked to enumerate all FD's and mark the trivial FD's
<p>Given a relation R(A,B,C) and a FD set (A->B, B->C), find the FD Closure. Enumerate all the FD's and organize them accordingly to the LHS of the FD's. Mark all the trivial FD's.</p>&#xA;&#xA;<p>I am a little confused with the second part of the question and don't understand what exactly they mean by "organize them a...
database theory databases functional dependencies
1
Given a relation and asked to enumerate all FD's and mark the trivial FD's -- (database theory databases functional dependencies) <p>Given a relation R(A,B,C) and a FD set (A->B, B->C), find the FD Closure. Enumerate all the FD's and organize them accordingly to the LHS of the FD's. Mark all the trivial FD's.</p>&#xA;&...
habedi/stack-exchange-dataset
100,583
First-order vs Higher-order Programs
<p>Can someone explain the difference between first-order programs and higher-order programs in the context of programming languages?</p>&#xA;&#xA;<p>My understanding so far is that Functional Languages (most) use higher order programs. Plus, higher functions either a) take other functions as arguments, or b) return fu...
programming languages compilers functional programming
1
First-order vs Higher-order Programs -- (programming languages compilers functional programming) <p>Can someone explain the difference between first-order programs and higher-order programs in the context of programming languages?</p>&#xA;&#xA;<p>My understanding so far is that Functional Languages (most) use higher or...
habedi/stack-exchange-dataset
100,591
Is there a way to theoretically compare hash functions?
<p>Say I am given two hash functions <code>f1</code> and <code>f2</code> is there anyway that I can prove one hash function will produce fewer collisions than another one? That is say for some domain assuming all values in the domain are equally likely to be chosen can I show that <code>f1</code> will on average perfor...
algorithm analysis hashing
1
Is there a way to theoretically compare hash functions? -- (algorithm analysis hashing) <p>Say I am given two hash functions <code>f1</code> and <code>f2</code> is there anyway that I can prove one hash function will produce fewer collisions than another one? That is say for some domain assuming all values in the domai...
habedi/stack-exchange-dataset
100,597
How can I make automaton that has given language?
<p><a href="https://i.stack.imgur.com/MvH8M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MvH8M.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>I am trying to solve above question, below is the automaton I came up with:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/R1cF5.jpg" rel=...
automata finite automata
1
How can I make automaton that has given language? -- (automata finite automata) <p><a href="https://i.stack.imgur.com/MvH8M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MvH8M.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>I am trying to solve above question, below is the automaton I ...
habedi/stack-exchange-dataset
100,599
Is legislation NP-complete?
<p>I would like to know if there has been any work relating legal code to complexity. In particular, suppose we have the decision problem "Given this law book and this particular set of circumstances, is the defendant guilty?" What complexity class does it belong to?</p>&#xA;&#xA;<p>There are results that have proven t...
complexity theory np complete decision problem
1
Is legislation NP-complete? -- (complexity theory np complete decision problem) <p>I would like to know if there has been any work relating legal code to complexity. In particular, suppose we have the decision problem "Given this law book and this particular set of circumstances, is the defendant guilty?" What complexi...
habedi/stack-exchange-dataset
100,601
Architecture - calculating miss penalty
<p>I know that <code>AVG Memory Access Time = Hit time + Miss Rate * Miss Penalty</code></p>&#xA;&#xA;<p>If I am given the AMAT and miss rate, aswell as the latency to access memory(call this x) how do I calculate the miss penalty &amp; / or Hit Time?</p>&#xA;&#xA;<p>For example:</p>&#xA;&#xA;<pre><code>AMAT = 80 (cycl...
cpu cache memory access
1
Architecture - calculating miss penalty -- (cpu cache memory access) <p>I know that <code>AVG Memory Access Time = Hit time + Miss Rate * Miss Penalty</code></p>&#xA;&#xA;<p>If I am given the AMAT and miss rate, aswell as the latency to access memory(call this x) how do I calculate the miss penalty &amp; / or Hit Time?...
habedi/stack-exchange-dataset
100,604
What is the concept of "encoding" in NP-completeness
<p>Hi I have been reading Ch 34(NP-Completeness) Section 34.1 of CLRS and I am confused why do we need to consider different encodings. Everything is represented as binary at the end so why consider different encodings of the input? &#xA;Any help is highly appreciated.</p>&#xA;
np encoding scheme
1
What is the concept of "encoding" in NP-completeness -- (np encoding scheme) <p>Hi I have been reading Ch 34(NP-Completeness) Section 34.1 of CLRS and I am confused why do we need to consider different encodings. Everything is represented as binary at the end so why consider different encodings of the input? &#xA;Any h...
habedi/stack-exchange-dataset
100,609
Possible to use Master theorem? $T(n) = aT(\lfloor \frac{n}{b} \rfloor) + g(n)$
<p>The master theorem can be used in case of a recurrence relation of the form <span class="math-container">$T(n) = aT(\frac{n}{b}) + g(n)$</span></p>&#xA;&#xA;<p>But is it possible to use the master theorem for recurrence relations of the form <span class="math-container">$T(n) = aT(\lfloor \frac{n}{b} \rfloor) + g(n)...
recurrence relation recursion master theorem
1
Possible to use Master theorem? $T(n) = aT(\lfloor \frac{n}{b} \rfloor) + g(n)$ -- (recurrence relation recursion master theorem) <p>The master theorem can be used in case of a recurrence relation of the form <span class="math-container">$T(n) = aT(\frac{n}{b}) + g(n)$</span></p>&#xA;&#xA;<p>But is it possible to use t...
habedi/stack-exchange-dataset
100,617
Automaton without variables and guards for queueing system
<p>Disclaimer: Assignment question.</p>&#xA;&#xA;<p>I am trying to solve the below question, the condition is not to use guards and variables. Is it at all possible to do this?</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/fV5k0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fV5k0.png" alt="ent...
automata finite automata
1
Automaton without variables and guards for queueing system -- (automata finite automata) <p>Disclaimer: Assignment question.</p>&#xA;&#xA;<p>I am trying to solve the below question, the condition is not to use guards and variables. Is it at all possible to do this?</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/fV5...
habedi/stack-exchange-dataset
100,618
Christofides algorithm (by hand) (suboptimal solution - is it my fault?)
<p>I would like to calculate an eularian path using Christofides algorithm on this graph: (Focus on the first number in each box representing the distance)</p>&#xA;&#xA;<ul>&#xA;<li><span class="math-container">$\alpha$</span> denotes the start and end vertex of the Eulerian path&#xA;<a href="https://i.stack.imgur.com/...
algorithms graphs matching spanning trees
1
Christofides algorithm (by hand) (suboptimal solution - is it my fault?) -- (algorithms graphs matching spanning trees) <p>I would like to calculate an eularian path using Christofides algorithm on this graph: (Focus on the first number in each box representing the distance)</p>&#xA;&#xA;<ul>&#xA;<li><span class="math-...
habedi/stack-exchange-dataset
100,633
Does simultaneously finding max/min in array of coordinates by x and y increase comparisons?
<p>I have an unsorted array of (x,y) coordinates and need to find the min/max for both (x) and (y) separately so that I can build a bounding box using <span class="math-container">$O(\frac{3n}{2})$</span> comparisons. </p>&#xA;&#xA;<p>If I use <a href="https://cs.stackexchange.com/a/52665/96958">this method to find the...
algorithms sorting
1
Does simultaneously finding max/min in array of coordinates by x and y increase comparisons? -- (algorithms sorting) <p>I have an unsorted array of (x,y) coordinates and need to find the min/max for both (x) and (y) separately so that I can build a bounding box using <span class="math-container">$O(\frac{3n}{2})$</span...
habedi/stack-exchange-dataset
100,641
Finding a correct regex for the strings with at least two $0s$
<p>I am learning CFGs and before that I've made a RE (Regular Expression) for the language of "all strings with at least two <span class="math-container">$0$</span>'s over the alphabet <span class="math-container">$\Sigma = \{0,1\}$</span>."</p>&#xA;&#xA;<p>I made this: <span class="math-container">$(0+1)^*0(0+1)^*0(0+...
context free regular expressions
1
Finding a correct regex for the strings with at least two $0s$ -- (context free regular expressions) <p>I am learning CFGs and before that I've made a RE (Regular Expression) for the language of "all strings with at least two <span class="math-container">$0$</span>'s over the alphabet <span class="math-container">$\Sig...
habedi/stack-exchange-dataset
100,642
What is the right term/theory for prediction of Binary Variables based upon their continuous value?
<p>I am working with a linear programming problem in which we have around 3500 binary variables. </p>&#xA;&#xA;<p>Usually IBM's Cplex takes around 72 hours to get an objective with a gap of around 15-20% with best bound. In the solution, we get around 85-90 binaries which have value of 1 and others are zero. The object...
optimization reference request linear programming integer programming
1
What is the right term/theory for prediction of Binary Variables based upon their continuous value? -- (optimization reference request linear programming integer programming) <p>I am working with a linear programming problem in which we have around 3500 binary variables. </p>&#xA;&#xA;<p>Usually IBM's Cplex takes aroun...
habedi/stack-exchange-dataset
100,646
$P=PP$ or $P=PSPACE$ vs $VP=VNP$
<p>We do not know if <span class="math-container">$P=NP$</span> has an impact on <span class="math-container">$VP=VNP$</span> however how about <span class="math-container">$P=PP$</span>?</p>&#xA;<ol>&#xA;<li><p>Is <span class="math-container">$PP$</span> and <span class="math-container">$VNP$</span> related and would ...
complexity theory np complexity classes polynomial time counting
1
$P=PP$ or $P=PSPACE$ vs $VP=VNP$ -- (complexity theory np complexity classes polynomial time counting) <p>We do not know if <span class="math-container">$P=NP$</span> has an impact on <span class="math-container">$VP=VNP$</span> however how about <span class="math-container">$P=PP$</span>?</p>&#xA;<ol>&#xA;<li><p>Is <s...
habedi/stack-exchange-dataset
100,650
Alternate proof of the Caro-Wei theorem for lower bounding the independence number
<p>Let <span class="math-container">$G$</span> be a graph on <span class="math-container">$n$</span> vertices whose degree sequence is <span class="math-container">$d_1,d_2,...,d_n$</span>. Let <span class="math-container">$\alpha(G)$</span> denote the size of maximum independent set of <span class="math-container">$G$...
graphs proof techniques combinatorics discrete mathematics
1
Alternate proof of the Caro-Wei theorem for lower bounding the independence number -- (graphs proof techniques combinatorics discrete mathematics) <p>Let <span class="math-container">$G$</span> be a graph on <span class="math-container">$n$</span> vertices whose degree sequence is <span class="math-container">$d_1,d_2,...
habedi/stack-exchange-dataset
100,662
Directed HAM Cycles with Additional Constraints to SAT
<p>The <span class="math-container">$n$</span> dimensional hypercube <span class="math-container">$Q_n$</span> is a graph that has a vertex <span class="math-container">$v_s$</span> for each string <span class="math-container">$s \in \{0, 1\}^n$</span> and an edge between two vertices <span class="math-container">$v_s$...
graphs reductions satisfiability
1
Directed HAM Cycles with Additional Constraints to SAT -- (graphs reductions satisfiability) <p>The <span class="math-container">$n$</span> dimensional hypercube <span class="math-container">$Q_n$</span> is a graph that has a vertex <span class="math-container">$v_s$</span> for each string <span class="math-container">...
habedi/stack-exchange-dataset
100,664
How to compute the complexity of $T(n) = T(n-2)+T(n-3)+2T(n/3)$?
<p><span class="math-container">$T(n) = T(n-2)+T(n-3)+2T(n/3)$</span> and <span class="math-container">$T(n)=1$</span> for <span class="math-container">$n&lt;4$</span>. &#xA;I tried to compute the complexity of <span class="math-container">$T(n) = T(n-2)+T(n-3)+2T(n/3)$</span> using the recursion tree but it's not clea...
asymptotics recurrence relation
1
How to compute the complexity of $T(n) = T(n-2)+T(n-3)+2T(n/3)$? -- (asymptotics recurrence relation) <p><span class="math-container">$T(n) = T(n-2)+T(n-3)+2T(n/3)$</span> and <span class="math-container">$T(n)=1$</span> for <span class="math-container">$n&lt;4$</span>. &#xA;I tried to compute the complexity of <span c...
habedi/stack-exchange-dataset
100,669
Registers in a CPU
<p><a href="https://en.wikipedia.org/wiki/Processor_register" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Processor_register</a> &#xA;So from the information in this link there are limited Floating point and General Purpose registers in a cpu. My question is how are these registers used. By that I mean let'...
cpu memory hardware memory access
1
Registers in a CPU -- (cpu memory hardware memory access) <p><a href="https://en.wikipedia.org/wiki/Processor_register" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Processor_register</a> &#xA;So from the information in this link there are limited Floating point and General Purpose registers in a cpu. My que...
habedi/stack-exchange-dataset
100,674
What is the solution of $T(n, m) = T(n, m-1) + T(n-1, m) + c$?
<p>Consider the recurrence&#xA;<span class="math-container">$$&#xA;T(n,m) = T(n,m-1) + T(n-1,m) + c,&#xA;$$</span>&#xA;with base cases <span class="math-container">$T(n,0) = T(0,m) = 1$</span>.</p>&#xA;&#xA;<p>This is the complexity of a recursive algorithm for the longest common subsequence, I know that the complexity...
asymptotics recurrence relation
1
What is the solution of $T(n, m) = T(n, m-1) + T(n-1, m) + c$? -- (asymptotics recurrence relation) <p>Consider the recurrence&#xA;<span class="math-container">$$&#xA;T(n,m) = T(n,m-1) + T(n-1,m) + c,&#xA;$$</span>&#xA;with base cases <span class="math-container">$T(n,0) = T(0,m) = 1$</span>.</p>&#xA;&#xA;<p>This is th...
habedi/stack-exchange-dataset
100,677
Why is this NP complete?
<p>I am looking at the diverse subset problem in Kleinberg and Tardos, shown in the image: </p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/wkzOW.png" alt=""></p>&#xA;&#xA;<p>Why can't we give a polynomial time algorithm for this? Cant we iterate through each person a, and then each item i, and then see for each pe...
complexity theory np complete
1
Why is this NP complete? -- (complexity theory np complete) <p>I am looking at the diverse subset problem in Kleinberg and Tardos, shown in the image: </p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/wkzOW.png" alt=""></p>&#xA;&#xA;<p>Why can't we give a polynomial time algorithm for this? Cant we iterate through e...
habedi/stack-exchange-dataset
100,683
Can a Turing Machine tell if an input string is a description of itself?
<p>Can some Turing Machine <span class="math-container">$M$</span> with description <span class="math-container">$\langle M\rangle$</span>, check if an input string <span class="math-container">$w$</span> is a description of itself? That is, can <span class="math-container">$M$</span> be constructed such that <span cla...
turing machines
1
Can a Turing Machine tell if an input string is a description of itself? -- (turing machines) <p>Can some Turing Machine <span class="math-container">$M$</span> with description <span class="math-container">$\langle M\rangle$</span>, check if an input string <span class="math-container">$w$</span> is a description of i...
habedi/stack-exchange-dataset
100,704
Reduce ATM to the language of TM encodings where if the TM accepts w then the TM accepts ww
<p>Today I did a test in my class, the trace was:</p>&#xA;&#xA;<blockquote>&#xA; <p><em>Prove that the language <span class="math-container">$L =\{\langle M\rangle\mid \forall w \in \{0,1\}^\ast: M \text{ accepts&#xA;}w\implies M \text { accepts }ww \}$</span>, is undecidable with a reduction&#xA; from <span class="m...
turing machines reductions undecidability
1
Reduce ATM to the language of TM encodings where if the TM accepts w then the TM accepts ww -- (turing machines reductions undecidability) <p>Today I did a test in my class, the trace was:</p>&#xA;&#xA;<blockquote>&#xA; <p><em>Prove that the language <span class="math-container">$L =\{\langle M\rangle\mid \forall w \i...
habedi/stack-exchange-dataset
100,705
Transition diagram for following token number
<p><strong>number -> digits(.digits)?(E[+ -]?digits)?</strong>&#xA;This transition diagram runs the above mentioned token I can not understand this how this is work.what is meaning of "?"Symbol and digits. can anyone explain me this</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/Rxc5U.png" rel="nofollow noreferre...
automata compilers
1
Transition diagram for following token number -- (automata compilers) <p><strong>number -> digits(.digits)?(E[+ -]?digits)?</strong>&#xA;This transition diagram runs the above mentioned token I can not understand this how this is work.what is meaning of "?"Symbol and digits. can anyone explain me this</p>&#xA;&#xA;<p...
habedi/stack-exchange-dataset
100,716
Is this a valid use of big-O notation?
<p>Suppose that <span class="math-container">$m=O(n^{c+1/2})$</span> for some real <span class="math-container">$c&gt;0$</span> and <span class="math-container">$x=O(\sqrt{\log m})$</span>. Are the following two computations valid? I understand that I'm abusing notations a bit to get at the desired results.</p>&#xA;&#x...
asymptotics landau notation
1
Is this a valid use of big-O notation? -- (asymptotics landau notation) <p>Suppose that <span class="math-container">$m=O(n^{c+1/2})$</span> for some real <span class="math-container">$c&gt;0$</span> and <span class="math-container">$x=O(\sqrt{\log m})$</span>. Are the following two computations valid? I understand tha...
habedi/stack-exchange-dataset
100,727
PL: What solves the type isomorphism $X \cong (X \rightarrow \mathbf{2})$?
<p>In <a href="http://profs.sci.univr.it/~merro/files/harper.pdf" rel="nofollow noreferrer"><em>Practical Foundations for Programming&#xA;Languages</em></a>, on page 138 (page 156 of the pdf), it says:</p>&#xA;&#xA;<blockquote>&#xA; <p>Requiring solutions to all type equations may seem suspicious, because&#xA; we kno...
programming languages type theory sets
1
PL: What solves the type isomorphism $X \cong (X \rightarrow \mathbf{2})$? -- (programming languages type theory sets) <p>In <a href="http://profs.sci.univr.it/~merro/files/harper.pdf" rel="nofollow noreferrer"><em>Practical Foundations for Programming&#xA;Languages</em></a>, on page 138 (page 156 of the pdf), it says:...
habedi/stack-exchange-dataset
100,732
Amplification for Randomized Algorithms
<p>I'm trying to show Amplification works for randomized algorithms, and for randomized approximation algorithms.</p>&#xA;&#xA;<hr>&#xA;&#xA;<p><strong>Amplification for randomized algorithms:</strong> <br>&#xA;Given a randomized algorithm with time complexity <span class="math-container">$f(n)$</span> and error probab...
algorithms approximation randomized algorithms
1
Amplification for Randomized Algorithms -- (algorithms approximation randomized algorithms) <p>I'm trying to show Amplification works for randomized algorithms, and for randomized approximation algorithms.</p>&#xA;&#xA;<hr>&#xA;&#xA;<p><strong>Amplification for randomized algorithms:</strong> <br>&#xA;Given a randomize...
habedi/stack-exchange-dataset
100,739
Is this algorithm of constant time?
<p>I have the following code in Python:</p>&#xA;&#xA;<pre><code>def is_unique(string):&#xA; if len(string) &lt;= 1:&#xA; return True&#xA;&#xA; if len(string) &gt; 128:&#xA; return False&#xA;&#xA; char_set = defaultdict(lambda: False)&#xA;&#xA; for char in string:&#xA; if not char_set[ch...
time complexity
1
Is this algorithm of constant time? -- (time complexity) <p>I have the following code in Python:</p>&#xA;&#xA;<pre><code>def is_unique(string):&#xA; if len(string) &lt;= 1:&#xA; return True&#xA;&#xA; if len(string) &gt; 128:&#xA; return False&#xA;&#xA; char_set = defaultdict(lambda: False)&#xA;&#...
habedi/stack-exchange-dataset
100,751
Relationship between Deterministic Finite Automata languages
<p>What this "⊃" superset means? What do I need to prove here. Can someone, please, explain in English? &#xA;Do I need to do a cross product?&#xA;Plus, in textbooks and online I only see "∩" "∪" these kinda symbols. What this symbols "⊃" means?</p>&#xA;&#xA;<pre><code>Let M = (K, Σ, δ, s, F) be a deterministic finite ...
finite automata
1
Relationship between Deterministic Finite Automata languages -- (finite automata) <p>What this "⊃" superset means? What do I need to prove here. Can someone, please, explain in English? &#xA;Do I need to do a cross product?&#xA;Plus, in textbooks and online I only see "∩" "∪" these kinda symbols. What this symbols "⊃"...
habedi/stack-exchange-dataset
100,757
(Formal) Proofs of Node Centrality Properties
<p>Despite there being relatively frequent discourse regarding the usage and effectiveness of various node centralities when analysing the influential spreaders of a graph, I have thus far struggled to find any formal treatments of such discussions. For example, betweeness centrality is theoretically well-defined and i...
graphs social networks network analysis
1
(Formal) Proofs of Node Centrality Properties -- (graphs social networks network analysis) <p>Despite there being relatively frequent discourse regarding the usage and effectiveness of various node centralities when analysing the influential spreaders of a graph, I have thus far struggled to find any formal treatments ...
habedi/stack-exchange-dataset
100,762
Linear ordering of all subsets of size k
<p>I was wondering if there is an obvious way to 'name' the <span class="math-container">${n \choose k}$</span> subsets of size <span class="math-container">$k$</span> of the integers from <span class="math-container">$1$</span> to <span class="math-container">$n$</span>. So I am looking for a bijection from the subset...
algorithms data structures terminology combinatorics
1
Linear ordering of all subsets of size k -- (algorithms data structures terminology combinatorics) <p>I was wondering if there is an obvious way to 'name' the <span class="math-container">${n \choose k}$</span> subsets of size <span class="math-container">$k$</span> of the integers from <span class="math-container">$1$...
habedi/stack-exchange-dataset
100,768
How to Solve TSP Given Length of Path?
<p>I am trying to devise an algorithm in which given the length of a path that satisfies the constraints of the Traveling Salesman Problem, I can find the path. Currently, my only solution is to find a cost matrix of every possible path and brute force adding them up until I get a solution that equals the length of th...
traveling salesman
1
How to Solve TSP Given Length of Path? -- (traveling salesman) <p>I am trying to devise an algorithm in which given the length of a path that satisfies the constraints of the Traveling Salesman Problem, I can find the path. Currently, my only solution is to find a cost matrix of every possible path and brute force add...
habedi/stack-exchange-dataset
100,770
expected pairwise square euclidean distance between points
<p>How can I show that the expected pairwise square euclidean distance between points in <span class="math-container">$X$</span> is <span class="math-container">$Θ(d)$</span>? </p>&#xA;&#xA;<p>Where <span class="math-container">$X$</span> is a <span class="math-container">$(x_1,...x_n)$</span> of points generated unifo...
probability theory randomized algorithms euclidean distance
1
expected pairwise square euclidean distance between points -- (probability theory randomized algorithms euclidean distance) <p>How can I show that the expected pairwise square euclidean distance between points in <span class="math-container">$X$</span> is <span class="math-container">$Θ(d)$</span>? </p>&#xA;&#xA;<p>Whe...
habedi/stack-exchange-dataset
100,777
Prove a^4n b^m is irregular using puming lemma
<p>My assignment is to prove that the language</p>&#xA;&#xA;<p><span class="math-container">$L = \{ a^{4n} b^m \mid n &gt; m &gt;= 0\}$</span> is not a regular language.</p>&#xA;&#xA;<p>My first attempt was to prove that if if you set <span class="math-container">$a^l$</span> and <span class="math-container">$b^{l-1}$<...
formal languages regular languages pumping lemma
1
Prove a^4n b^m is irregular using puming lemma -- (formal languages regular languages pumping lemma) <p>My assignment is to prove that the language</p>&#xA;&#xA;<p><span class="math-container">$L = \{ a^{4n} b^m \mid n &gt; m &gt;= 0\}$</span> is not a regular language.</p>&#xA;&#xA;<p>My first attempt was to prove tha...
habedi/stack-exchange-dataset
100,778
Find total number of assignment in the worst case?
<p>I have this algorithm</p>&#xA;&#xA;<pre><code>Algorithm (A[1..n])&#xA; for i &lt;- 1 to n do&#xA; if (A[i] &lt; 0) then&#xA; A[i] &lt;- 1 * A[i]&#xA; End if&#xA; End for&#xA;</code></pre>&#xA;&#xA;<p>I have to find the total number of assignment in the worst case, but I'm a little bit ...
algorithms algorithm analysis
1
Find total number of assignment in the worst case? -- (algorithms algorithm analysis) <p>I have this algorithm</p>&#xA;&#xA;<pre><code>Algorithm (A[1..n])&#xA; for i &lt;- 1 to n do&#xA; if (A[i] &lt; 0) then&#xA; A[i] &lt;- 1 * A[i]&#xA; End if&#xA; End for&#xA;</code></pre>&#xA;&#xA;<p>...
habedi/stack-exchange-dataset
100,779
Can someone explain the language L = {w: w = uu, u \in La(1*01*)}
<p><img src="https://latex.codecogs.com/gif.latex?L=(w:w=uu,&space;u%5Cin&space;L_%7Ba%7D(1%5E%7B*%7D01%5E%7B*%7D))" title="L=(w:w=uu, u\in L_{a}(1^{*}01^{*}))" /></p>&#xA;&#xA;<p>I need help understanding the language <code>L</code> above. <br/></p>&#xA;&#xA;<p>These are my understanding: <br/>&#xA;- <code>w = uu</cod...
formal languages regular languages regular expressions
1
Can someone explain the language L = {w: w = uu, u \in La(1*01*)} -- (formal languages regular languages regular expressions) <p><img src="https://latex.codecogs.com/gif.latex?L=(w:w=uu,&space;u%5Cin&space;L_%7Ba%7D(1%5E%7B*%7D01%5E%7B*%7D))" title="L=(w:w=uu, u\in L_{a}(1^{*}01^{*}))" /></p>&#xA;&#xA;<p>I need help un...
habedi/stack-exchange-dataset
100,784
What does binary NP-Hard exactly mean?
<p>Can someone tell me what binary NP-Hard exactly means. &#xA;My understanding was that if the problem is encoded in binary and if the problem is binary NP-Hard, its complexity of solving is NP-Hard. Is this the correct interpretation?</p>&#xA;&#xA;<p>I also wanted to know, if binary NP-Hard also says something about ...
complexity theory
1
What does binary NP-Hard exactly mean? -- (complexity theory) <p>Can someone tell me what binary NP-Hard exactly means. &#xA;My understanding was that if the problem is encoded in binary and if the problem is binary NP-Hard, its complexity of solving is NP-Hard. Is this the correct interpretation?</p>&#xA;&#xA;<p>I als...
habedi/stack-exchange-dataset
100,791
Trying to prove semidecidability of an undecidable language
<p>I have been having a hard time understanding whether the set <span class="math-container">$S = \{ M \mid |L(M)| = 5 \}$</span> is semidecidable or not, where <span class="math-container">$M$</span> is a generic Turing Machine and <span class="math-container">$L(M)$</span> the language accepted by such TM, which cons...
turing machines computability rice theorem
1
Trying to prove semidecidability of an undecidable language -- (turing machines computability rice theorem) <p>I have been having a hard time understanding whether the set <span class="math-container">$S = \{ M \mid |L(M)| = 5 \}$</span> is semidecidable or not, where <span class="math-container">$M$</span> is a generi...
habedi/stack-exchange-dataset
100,802
Find the efficiency class
<p>I have to find the efficiency class of this algorithm </p>&#xA;&#xA;<pre><code>b = 3&#xA;a = 4&#xA;for i = 4 to n^2&#xA; if (i mod 2 == 0)&#xA; a = a+2 &#xA; else&#xA; b = b*3&#xA;end for&#xA;</code></pre>&#xA;&#xA;<p>I solve it like this, first I find the time for executed a then b and the total...
algorithm analysis runtime analysis loops
1
Find the efficiency class -- (algorithm analysis runtime analysis loops) <p>I have to find the efficiency class of this algorithm </p>&#xA;&#xA;<pre><code>b = 3&#xA;a = 4&#xA;for i = 4 to n^2&#xA; if (i mod 2 == 0)&#xA; a = a+2 &#xA; else&#xA; b = b*3&#xA;end for&#xA;</code></pre>&#xA;&#xA;<p>I solv...
habedi/stack-exchange-dataset
100,806
Intuitive proof for a tree with n nodes, has n-1 edges
<p>I am interested in an intuitive proof for "any binary tree with <span class="math-container">$n$</span> nodes has <span class="math-container">$n-1$</span> edges", that goes beyond proof by strong induction. </p>&#xA;
graphs trees proof techniques
1
Intuitive proof for a tree with n nodes, has n-1 edges -- (graphs trees proof techniques) <p>I am interested in an intuitive proof for "any binary tree with <span class="math-container">$n$</span> nodes has <span class="math-container">$n-1$</span> edges", that goes beyond proof by strong induction. </p>&#xA;
habedi/stack-exchange-dataset
100,810
Dominance Law in Boolean Algebra
<p>The dominance law states that <strong>x + 1 = 1</strong></p>&#xA;&#xA;<p>If we go by that logic, does that mean that <strong>x' + 1 = 1?</strong></p>&#xA;&#xA;<p>Please just tell me if it's a yes(as I think that this is the answer but I just want to clear my doubts) and maybe provide a little explanation if it's a n...
algebra
1
Dominance Law in Boolean Algebra -- (algebra) <p>The dominance law states that <strong>x + 1 = 1</strong></p>&#xA;&#xA;<p>If we go by that logic, does that mean that <strong>x' + 1 = 1?</strong></p>&#xA;&#xA;<p>Please just tell me if it's a yes(as I think that this is the answer but I just want to clear my doubts) and ...
habedi/stack-exchange-dataset
100,812
regex - difference between $\Lambda+(a+b)^*b$ and $(b+aa^*b)^*$
<p><a href="https://i.stack.imgur.com/p0COX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p0COX.png" alt="FA"></a><br>&#xA;<span class="math-container">$r_1=\Lambda+(a+b)^*b$</span><br>&#xA;<span class="math-container">$r_2=(b+aa^*b)^*$</span><br>&#xA;<span class="math-container">$r_3=b+\$+aa^*b+(b...
formal languages finite automata regular expressions
1
regex - difference between $\Lambda+(a+b)^*b$ and $(b+aa^*b)^*$ -- (formal languages finite automata regular expressions) <p><a href="https://i.stack.imgur.com/p0COX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p0COX.png" alt="FA"></a><br>&#xA;<span class="math-container">$r_1=\Lambda+(a+b)^*b$</s...
habedi/stack-exchange-dataset
100,824
Nearest Insertion Traveling Salesman Heuristic: is it faster to insert nearest nodes first?
<p>I am trying to implement the nearest insertion TSP heuristic. However, I am wondering if it matters which node I insert into the subgraph first. </p>&#xA;&#xA;<p>For example, should I start with one node; calculate the distance between this node and the other nodes; and sort the other nodes by this distance? Then, I...
algorithms heuristics traveling salesman
1
Nearest Insertion Traveling Salesman Heuristic: is it faster to insert nearest nodes first? -- (algorithms heuristics traveling salesman) <p>I am trying to implement the nearest insertion TSP heuristic. However, I am wondering if it matters which node I insert into the subgraph first. </p>&#xA;&#xA;<p>For example, shou...
habedi/stack-exchange-dataset
100,830
Find two numbers in array $A$ such that $ |x-y| \leq \frac{\max(A)-\min(A)}n$ in linear time
<p>I'm struggling with the following question:</p>&#xA;&#xA;<blockquote>&#xA; <p>Let <span class="math-container">$\langle a_0, a_1,\dots,a_n\rangle$</span> be a sequence of real numbers, and let <span class="math-container">$ M =&#xA;\max\{a_0, a_1, .... a_n\} $</span> and <span class="math-container">$ m = \min\{a_...
algorithms time complexity selection problem
1
Find two numbers in array $A$ such that $ |x-y| \leq \frac{\max(A)-\min(A)}n$ in linear time -- (algorithms time complexity selection problem) <p>I'm struggling with the following question:</p>&#xA;&#xA;<blockquote>&#xA; <p>Let <span class="math-container">$\langle a_0, a_1,\dots,a_n\rangle$</span> be a sequence of re...
habedi/stack-exchange-dataset
100,831
Trouble understanding this proof about the minimum number of states of a deterministic finite automaton
<p>So I was browsing online looking for the general structure to proving a DFA has a minimum of <span class="math-container">$n$</span> states for some <span class="math-container">$n$</span> and most of them use contradiction. However, I'm having a hard time understanding why the <a href="https://courses.engr.illinois...
automata finite automata proof techniques
1
Trouble understanding this proof about the minimum number of states of a deterministic finite automaton -- (automata finite automata proof techniques) <p>So I was browsing online looking for the general structure to proving a DFA has a minimum of <span class="math-container">$n$</span> states for some <span class="math...
habedi/stack-exchange-dataset
100,832
Algorithm to find smallest number divisible by N with sum of digits as N
<p>Problem:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given <span class="math-container">$N$</span>, find the smallest number divisible by <span class="math-container">$N$</span> whose sum of digits is equal <span class="math-container">$N$</span>.</p>&#xA;</blockquote>&#xA;&#xA;<p>For example:</p>&#xA;&#xA;<ul>&#xA;<li><span...
dynamic programming
1
Algorithm to find smallest number divisible by N with sum of digits as N -- (dynamic programming) <p>Problem:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given <span class="math-container">$N$</span>, find the smallest number divisible by <span class="math-container">$N$</span> whose sum of digits is equal <span class="math-con...
habedi/stack-exchange-dataset
100,833
Find all values repeating more than $\lfloor n/k \rfloor$ times in $O(n \log k)$ time
<p>Given a parameter <span class="math-container">$k$</span> and an array (not sorted) of length <span class="math-container">$n$</span> return all values which repeat more than <span class="math-container">$\lfloor n/k \rfloor$</span> times in <span class="math-container">$O(n \log k)$</span> time.</p>&#xA;&#xA;<p>I'v...
algorithms data structures time complexity
1
Find all values repeating more than $\lfloor n/k \rfloor$ times in $O(n \log k)$ time -- (algorithms data structures time complexity) <p>Given a parameter <span class="math-container">$k$</span> and an array (not sorted) of length <span class="math-container">$n$</span> return all values which repeat more than <span cl...
habedi/stack-exchange-dataset
100,834
Determining initial and final states from FA diagram
<p>I am new to automata. And learning to find concatenation of two FAs. But this one has confused me<br>&#xA;<a href="https://i.stack.imgur.com/pzfKq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pzfKq.png" alt="FA 1"></a><br>&#xA;<a href="https://i.stack.imgur.com/VIiCF.png" rel="nofollow noreferr...
automata finite automata regular expressions
1
Determining initial and final states from FA diagram -- (automata finite automata regular expressions) <p>I am new to automata. And learning to find concatenation of two FAs. But this one has confused me<br>&#xA;<a href="https://i.stack.imgur.com/pzfKq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/...
habedi/stack-exchange-dataset
100,842
Monte Carlo Algorithms : Are there any problems where two opposite Monte Carlo algorithms could solve it?
<p>I started reading on Probabilistic algorithms and Monte-Carlo algorithms. Since a Monte-Carlo can only give a certain answer for either True or False, I was wondering if it's conceivable that <strong>for the same problem</strong>, there exist two opposite Monte-Carlo Algorithms capable of giving a certain answer. (B...
probabilistic algorithms monte carlo
1
Monte Carlo Algorithms : Are there any problems where two opposite Monte Carlo algorithms could solve it? -- (probabilistic algorithms monte carlo) <p>I started reading on Probabilistic algorithms and Monte-Carlo algorithms. Since a Monte-Carlo can only give a certain answer for either True or False, I was wondering if...
habedi/stack-exchange-dataset
100,858
How binary search works in real world scenario?
<p>In binary search, we need an array of <strong>integers</strong> for it to search for an element. Also, many other sorting algorithm sorts array of <strong>integers</strong>.</p>&#xA;&#xA;<p>But in real world, we may search for a name of an employee in a database, title of a post etc. So how does binary search actual...
algorithms search algorithms binary search
1
How binary search works in real world scenario? -- (algorithms search algorithms binary search) <p>In binary search, we need an array of <strong>integers</strong> for it to search for an element. Also, many other sorting algorithm sorts array of <strong>integers</strong>.</p>&#xA;&#xA;<p>But in real world, we may searc...
habedi/stack-exchange-dataset
100,865
How come O(n) + O(logn) = O(logn)
<p>How come O(n) + O(logn) = O(logn)?</p>&#xA;&#xA;<p>When talking for example about an algorithm that has two operations. One of them takes O(n) and the other O(logn) and in the end we say that the total complexity is O(logn). It doesn't make sense to me since n is bigger than logn.</p>&#xA;
asymptotics landau notation
1
How come O(n) + O(logn) = O(logn) -- (asymptotics landau notation) <p>How come O(n) + O(logn) = O(logn)?</p>&#xA;&#xA;<p>When talking for example about an algorithm that has two operations. One of them takes O(n) and the other O(logn) and in the end we say that the total complexity is O(logn). It doesn't make sense to ...
habedi/stack-exchange-dataset
100,866
Language of all strings that has exactly 1 triple b
<p>I am new to automata and learning to make regular expression for languages. But I have been stuck on this one.</p>&#xA;&#xA;<p>Suppose we have a language L, Language of all strings that has exactly 1 triple <strong>“b”</strong> defined over alphabet set <strong>Σ = {a, b}</strong><br>&#xA;Now after several tries, I ...
automata finite automata regular expressions
1
Language of all strings that has exactly 1 triple b -- (automata finite automata regular expressions) <p>I am new to automata and learning to make regular expression for languages. But I have been stuck on this one.</p>&#xA;&#xA;<p>Suppose we have a language L, Language of all strings that has exactly 1 triple <strong>...
habedi/stack-exchange-dataset
100,882
Is it possible to create a regular language from an non regular language? (details inside)
<p>I am wondering, is it is possible to create a regular language from a non regular language if we add or remove finite number of words from it?</p>&#xA;&#xA;<p>say L is irregular, if we add or remove finite number of words can we create a regular language?</p>&#xA;&#xA;<p>i might be mistaken, but since all regular la...
automata regular languages finite automata
1
Is it possible to create a regular language from an non regular language? (details inside) -- (automata regular languages finite automata) <p>I am wondering, is it is possible to create a regular language from a non regular language if we add or remove finite number of words from it?</p>&#xA;&#xA;<p>say L is irregular,...
habedi/stack-exchange-dataset
100,892
Is this concatenation of two FA done right?
<p><span class="math-container">$r_3=r_1r_2=(a^*b)^*(a+ba)^*bb(a+b)^*$</span> comes out to be <span class="math-container">$r_3=r_2=(a+ba)^*bb(a+b)^*$</span> when i <a href="http://ivanzuzak.info/noam/webapps/fsm2regex/" rel="nofollow noreferrer">generate the resultant FA and its regex</a> after concatenation i.e. it d...
formal languages automata finite automata regular expressions
1
Is this concatenation of two FA done right? -- (formal languages automata finite automata regular expressions) <p><span class="math-container">$r_3=r_1r_2=(a^*b)^*(a+ba)^*bb(a+b)^*$</span> comes out to be <span class="math-container">$r_3=r_2=(a+ba)^*bb(a+b)^*$</span> when i <a href="http://ivanzuzak.info/noam/webapps/...
habedi/stack-exchange-dataset
100,894
DFA that accepts strings with last character being repeated at least 1 time before
<p>I'm trying to design a DFA in a 4 digit language, for example L(a,b,c,d) or L(1,2,3,4) that accepts strings with the last character being already repeated before.</p>&#xA;&#xA;<p>Everyway im trying, i get so many transitions im literally lost in them...</p>&#xA;&#xA;<p>So, for example, abbdb is accepted (because b i...
automata finite automata
1
DFA that accepts strings with last character being repeated at least 1 time before -- (automata finite automata) <p>I'm trying to design a DFA in a 4 digit language, for example L(a,b,c,d) or L(1,2,3,4) that accepts strings with the last character being already repeated before.</p>&#xA;&#xA;<p>Everyway im trying, i get...
habedi/stack-exchange-dataset
100,903
Big O notation for finding duplicates in a list using binary search
<p>I've written an algorithm to find duplicate integers in a sequential list of integers, but I'm running into issues when trying to calculate it's worst case complexity.</p>&#xA;&#xA;<p>Given a sequential list of integers the algorithm is as follows:</p>&#xA;&#xA;<pre><code>1. get the length of the list of integers, a...
algorithms complexity theory algorithm analysis
1
Big O notation for finding duplicates in a list using binary search -- (algorithms complexity theory algorithm analysis) <p>I've written an algorithm to find duplicate integers in a sequential list of integers, but I'm running into issues when trying to calculate it's worst case complexity.</p>&#xA;&#xA;<p>Given a sequ...
habedi/stack-exchange-dataset
100,904
Are you allowed to change the specifications of a problem when doing reductions?
<p>I'm doing a polynomial time reduction from problem <strong>A</strong> (known graph problem) to problem <strong>B</strong> (funky and specific longest path problem). There is a lot of demands on how problem <strong>B</strong> is supposed to be solved. However, the input of problem <strong>A</strong> does not give me ...
graphs reductions polynomial time
1
Are you allowed to change the specifications of a problem when doing reductions? -- (graphs reductions polynomial time) <p>I'm doing a polynomial time reduction from problem <strong>A</strong> (known graph problem) to problem <strong>B</strong> (funky and specific longest path problem). There is a lot of demands on how...
habedi/stack-exchange-dataset
100,908
(M)ILP overlap of two intervals
<p>I got an ILP Model where <span class="math-container">$c_i$</span> represents the starting time for a visit<span class="math-container">$_i$</span>.&#xA;<span class="math-container">$c_i$</span> is already constraint by a number of constraints, one is <span class="math-container">$c_i &gt; 0$</span>.</p>&#xA;&#xA;<p...
linear programming integer programming intervals constraint programming
1
(M)ILP overlap of two intervals -- (linear programming integer programming intervals constraint programming) <p>I got an ILP Model where <span class="math-container">$c_i$</span> represents the starting time for a visit<span class="math-container">$_i$</span>.&#xA;<span class="math-container">$c_i$</span> is already co...
habedi/stack-exchange-dataset
100,912
Time complexity dependent on magnitude of input
<p>I'm trying to analyze an algorithm that looks like this:</p>&#xA;&#xA;<pre><code>def foo(L):&#xA; for n in L:&#xA; for x in range(n):&#xA; ...&#xA;</code></pre>&#xA;&#xA;<p>What would be its time complexity? First I thought <span class="math-container">$O(n)$</span>, where <span class="math-cont...
algorithm analysis runtime analysis loops
1
Time complexity dependent on magnitude of input -- (algorithm analysis runtime analysis loops) <p>I'm trying to analyze an algorithm that looks like this:</p>&#xA;&#xA;<pre><code>def foo(L):&#xA; for n in L:&#xA; for x in range(n):&#xA; ...&#xA;</code></pre>&#xA;&#xA;<p>What would be its time compl...
habedi/stack-exchange-dataset
100,919
Can we detect perfect matchings in P? in NP? in coNP?
<p>This question concerns the classes P and N P . If you are familiar with them, you may skip the definitions and go directly to the question. &#xA;Let L be a set. We say that L is in P if there is some algorithm which given input x decides if x is in L or not in time bounded by a polynomial in the length of x. For exa...
p vs np
1
Can we detect perfect matchings in P? in NP? in coNP? -- (p vs np) <p>This question concerns the classes P and N P . If you are familiar with them, you may skip the definitions and go directly to the question. &#xA;Let L be a set. We say that L is in P if there is some algorithm which given input x decides if x is in L...
habedi/stack-exchange-dataset
100,930
Defining Gap Problems
<p>I recently started studying about approximation problems in the complexity class that I'm taking. I feel like some of the definitions in this subject presented in my course and that I came across online are somewhat inaccurate and confusing.</p>&#xA;&#xA;<p>Specifically, the concept of <strong>gap problems</strong> ...
complexity theory approximation
1
Defining Gap Problems -- (complexity theory approximation) <p>I recently started studying about approximation problems in the complexity class that I'm taking. I feel like some of the definitions in this subject presented in my course and that I came across online are somewhat inaccurate and confusing.</p>&#xA;&#xA;<p>...
habedi/stack-exchange-dataset
100,934
Applications of divide-and-conquer outside of merge sort and quicksort
<p>What are other algorithms that use the divide-and-conquer paradigm aside from merge sort and quicksort?</p>&#xA;
algorithms reference request divide and conquer
1
Applications of divide-and-conquer outside of merge sort and quicksort -- (algorithms reference request divide and conquer) <p>What are other algorithms that use the divide-and-conquer paradigm aside from merge sort and quicksort?</p>&#xA;
habedi/stack-exchange-dataset
100,935
is it possible to know if a language is regular if its equivalence classes are finite?
<p>i have a theoretical questions, and was wondering if you could help me with it so i could understand the material better.</p>&#xA;&#xA;<p>1)suppose we have some language L over <span class="math-container">$\Sigma$</span>, can we know if L is regular if all of it equivalence classes of relation <span class="math-con...
automata regular languages finite automata
1
is it possible to know if a language is regular if its equivalence classes are finite? -- (automata regular languages finite automata) <p>i have a theoretical questions, and was wondering if you could help me with it so i could understand the material better.</p>&#xA;&#xA;<p>1)suppose we have some language L over <span...
habedi/stack-exchange-dataset
100,942
Counterexample for simple parity automaton reduction
<p>I am dealing with deterministic parity automata and state space reduction (not minimization).</p>&#xA;&#xA;<p>If we define <span class="math-container">$\equiv_L$</span> to be the equivalence relation that sets two states equal iff starting from those states the automaton recognizes the same <span class="math-contai...
automata omega automata
1
Counterexample for simple parity automaton reduction -- (automata omega automata) <p>I am dealing with deterministic parity automata and state space reduction (not minimization).</p>&#xA;&#xA;<p>If we define <span class="math-container">$\equiv_L$</span> to be the equivalence relation that sets two states equal iff sta...
habedi/stack-exchange-dataset
100,944
Counterexample to an Algorithm Complexity Statement
<p>Say I have the following statement:</p>&#xA;&#xA;<blockquote>&#xA; <p>If <span class="math-container">$f(n) = O(s(n))$</span> and <span class="math-container">$g(n) = O(r(n))$</span>, then <span class="math-container">$f(n) - g(n) = \Theta(s(n) - r(n))$</span>.</p>&#xA;</blockquote>&#xA;&#xA;<p>What would be a coun...
algorithm analysis
1
Counterexample to an Algorithm Complexity Statement -- (algorithm analysis) <p>Say I have the following statement:</p>&#xA;&#xA;<blockquote>&#xA; <p>If <span class="math-container">$f(n) = O(s(n))$</span> and <span class="math-container">$g(n) = O(r(n))$</span>, then <span class="math-container">$f(n) - g(n) = \Theta(...
habedi/stack-exchange-dataset
100,965
Regex for bit strings with at least two zeros but no consecutive zeros
<p>This is what I have:</p>&#xA;&#xA;<p><span class="math-container">$$(1^*011^*011^*)^*\,.$$</span></p>&#xA;&#xA;<p>But I don't think this is accounting for an odd number of zeros, like "<span class="math-container">$10101010101111$</span>". I think I have the right expression that satisfies no 2 consecutive zeros and...
regular expressions
1
Regex for bit strings with at least two zeros but no consecutive zeros -- (regular expressions) <p>This is what I have:</p>&#xA;&#xA;<p><span class="math-container">$$(1^*011^*011^*)^*\,.$$</span></p>&#xA;&#xA;<p>But I don't think this is accounting for an odd number of zeros, like "<span class="math-container">$101010...
habedi/stack-exchange-dataset
100,966
Whether language of all turing machines is decidable or undecidable or semi-decidable?
<p>I recently came across this language:</p>&#xA;&#xA;<p><span class="math-container">$L=\{&lt;TM&gt;| \text{TM accepts recursively enumerable languages}\}$</span></p>&#xA;&#xA;<p>It was asked in the question to find out whether language L is decidable or undecidable. </p>&#xA;&#xA;<p>As far as I could reason out, lang...
turing machines computability undecidability semi decidability
1
Whether language of all turing machines is decidable or undecidable or semi-decidable? -- (turing machines computability undecidability semi decidability) <p>I recently came across this language:</p>&#xA;&#xA;<p><span class="math-container">$L=\{&lt;TM&gt;| \text{TM accepts recursively enumerable languages}\}$</span></...
habedi/stack-exchange-dataset
100,982
Given that A reduces to B in $O(n^2)$ and B is solvable in $O(n^3)$, solve A
<blockquote>&#xA;<p>Suppose a problem A reduce to problem B and reduction is done in <span class="math-container">$O(n^2)$</span> time.</p>&#xA;<p>If problem B is solved in <span class="math-container">$O(n^3)$</span> time then what about the time complexity of problem A?</p>&#xA;</blockquote>&#xA;<p>Approach:</p>&#xA;...
reductions p vs np
1
Given that A reduces to B in $O(n^2)$ and B is solvable in $O(n^3)$, solve A -- (reductions p vs np) <blockquote>&#xA;<p>Suppose a problem A reduce to problem B and reduction is done in <span class="math-container">$O(n^2)$</span> time.</p>&#xA;<p>If problem B is solved in <span class="math-container">$O(n^3)$</span> t...
habedi/stack-exchange-dataset
100,990
Is it decidable whether one language is polytime reducible to another?
<p>Let <span class="math-container">$L_1$</span> and <span class="math-container">$L_2$</span> be two decision problems. </p>&#xA;&#xA;<p>Is there an algorithm deciding whether <span class="math-container">$L_1 \leq_P L_2$</span>, that is, whether <span class="math-container">$L_1$</span> is reducible to <span class="...
complexity theory
1
Is it decidable whether one language is polytime reducible to another? -- (complexity theory) <p>Let <span class="math-container">$L_1$</span> and <span class="math-container">$L_2$</span> be two decision problems. </p>&#xA;&#xA;<p>Is there an algorithm deciding whether <span class="math-container">$L_1 \leq_P L_2$</s...
habedi/stack-exchange-dataset
100,991
Does a Vertex Cover exist?
<p>This should be a simple question, but I am a little bit confused.</p>&#xA;&#xA;<p>A proof on page 556 of <a href="https://rads.stackoverflow.com/amzn/click/0321295358" rel="nofollow noreferrer">Algorithm Design</a> says:</p>&#xA;&#xA;<p>"Let <span class="math-container">$e=(u, v)$</span> be any edge of <span class="...
graphs
1
Does a Vertex Cover exist? -- (graphs) <p>This should be a simple question, but I am a little bit confused.</p>&#xA;&#xA;<p>A proof on page 556 of <a href="https://rads.stackoverflow.com/amzn/click/0321295358" rel="nofollow noreferrer">Algorithm Design</a> says:</p>&#xA;&#xA;<p>"Let <span class="math-container">$e=(u, ...
habedi/stack-exchange-dataset
100,999
Minimum number of components in graph
<p>Minimum number of components in graph where we have 69 vertices and 43 edges. I think the best way is to create a path? One path and the rest would be isolated components. Since in path we use only one edge for 2 vertices. Correct?</p>&#xA;
graphs
1
Minimum number of components in graph -- (graphs) <p>Minimum number of components in graph where we have 69 vertices and 43 edges. I think the best way is to create a path? One path and the rest would be isolated components. Since in path we use only one edge for 2 vertices. Correct?</p>&#xA;
habedi/stack-exchange-dataset
101,002
Algorithm challenge: build a pile of 'n' cubes whose total volume adds up to 'm'
<p>I'm working on solving an <a href="https://www.codewars.com/kata/build-a-pile-of-cubes/train/python" rel="nofollow noreferrer">algorithm problem</a> defined as follows (important parts in bold):</p>&#xA;&#xA;<blockquote>&#xA; <p>Your task is to construct a building which will be a <strong>pile of n cubes</strong>. ...
algorithms optimization floating point
1
Algorithm challenge: build a pile of 'n' cubes whose total volume adds up to 'm' -- (algorithms optimization floating point) <p>I'm working on solving an <a href="https://www.codewars.com/kata/build-a-pile-of-cubes/train/python" rel="nofollow noreferrer">algorithm problem</a> defined as follows (important parts in bold...
habedi/stack-exchange-dataset
101,018
More efficient maximum bipartite matching
<p>I've been looking into weighted matching in bipartite graphs and am currently looking at maximum matchings in weighted bipartite graphs. As I've been reading and poking around at different books and papers, I've noticed that the Hungarian/Kuhn's algorithm tends to get mentioned a lot as a solution/approach. My stick...
algorithms graphs reference request weighted graphs bipartite matching
1
More efficient maximum bipartite matching -- (algorithms graphs reference request weighted graphs bipartite matching) <p>I've been looking into weighted matching in bipartite graphs and am currently looking at maximum matchings in weighted bipartite graphs. As I've been reading and poking around at different books and ...
habedi/stack-exchange-dataset
101,027
Distribute a number of tasks into multiple days (scheduling)
<p>This is about scheduling. I have N tasks of different length and I have to schedule them into M days. Indeed, each day has a max capacity (usually they are the same). Parameters are tight in the sense, that the sum of taks' length is exactly the same as the sum of day's capacity, e.g. tasks of total length 150 must ...
algorithms scheduling
1
Distribute a number of tasks into multiple days (scheduling) -- (algorithms scheduling) <p>This is about scheduling. I have N tasks of different length and I have to schedule them into M days. Indeed, each day has a max capacity (usually they are the same). Parameters are tight in the sense, that the sum of taks' lengt...
habedi/stack-exchange-dataset
101,030
Proving that a spanning tree of graph is not a minimum
<p>Let <span class="math-container">$G$</span> be an undirected and connected graph. Let <span class="math-container">$T$</span> be a spanning tree of <span class="math-container">$G$</span> with edges weights: <span class="math-container">$w_1 \le, w_2 \le ... \le w_{n-1}$</span> which are responing to the edges. <spa...
algorithms graphs minimum spanning tree
1
Proving that a spanning tree of graph is not a minimum -- (algorithms graphs minimum spanning tree) <p>Let <span class="math-container">$G$</span> be an undirected and connected graph. Let <span class="math-container">$T$</span> be a spanning tree of <span class="math-container">$G$</span> with edges weights: <span cla...
habedi/stack-exchange-dataset
101,031
Minimizing sum of recursive pairwise sums
<p>What is the best algorithm for this?</p>&#xA;&#xA;<p>We are given an array of positive integers and we want to <strong>minimize the total cost</strong> of recursively adding together all the integers to one integer, <strong>two integers at a time</strong>. The cost of each addition is the sum of the two integers, an...
algorithms optimization
1
Minimizing sum of recursive pairwise sums -- (algorithms optimization) <p>What is the best algorithm for this?</p>&#xA;&#xA;<p>We are given an array of positive integers and we want to <strong>minimize the total cost</strong> of recursively adding together all the integers to one integer, <strong>two integers at a time...
habedi/stack-exchange-dataset
101,037
Why not do these checks on the number of clauses in 3-SAT?
<p>I've been writing a 3-SAT solver for fun and comparing its performance against the solver <a href="https://pypi.org/project/pycosat/" rel="nofollow noreferrer">pycosat</a>. My solver vastly outperforms pycosat in two special cases, where I solve by doing simple, obvious checks, which pycosat doesn't seem to do (base...
satisfiability 3 sat sat solvers
1
Why not do these checks on the number of clauses in 3-SAT? -- (satisfiability 3 sat sat solvers) <p>I've been writing a 3-SAT solver for fun and comparing its performance against the solver <a href="https://pypi.org/project/pycosat/" rel="nofollow noreferrer">pycosat</a>. My solver vastly outperforms pycosat in two spe...
habedi/stack-exchange-dataset
101,038
Do any two spanning trees of a simple graph always have some common edges?
<p>I tried few cases and found any two spanning tree of a simple graph has some common edges. I mean I couldn't find any counter example so far. But I couldn't prove or disprove this either. How to prove or disprove this conjecture? </p>&#xA;
graphs spanning trees
1
Do any two spanning trees of a simple graph always have some common edges? -- (graphs spanning trees) <p>I tried few cases and found any two spanning tree of a simple graph has some common edges. I mean I couldn't find any counter example so far. But I couldn't prove or disprove this either. How to prove or disprove ...
habedi/stack-exchange-dataset
101,042
Can a list with $\mathcal{O}(1)$ access have an insertion complexity better than $\mathcal{O}(n)$?
<p>It seems intuitive that there's no list data structure which has <span class="math-container">$\mathcal{O}(1)$</span> worst case time complexity for random access and a worst case complexity better than <span class="math-container">$\mathcal{O}(n)$</span> for insertion: if insertion is allowed to affect only a <em>...
time complexity lists
1
Can a list with $\mathcal{O}(1)$ access have an insertion complexity better than $\mathcal{O}(n)$? -- (time complexity lists) <p>It seems intuitive that there's no list data structure which has <span class="math-container">$\mathcal{O}(1)$</span> worst case time complexity for random access and a worst case complexity...
habedi/stack-exchange-dataset
101,055
Soundness and completeness w.r.t. programming languages
<p>I'm studying programming languages (more specifically type systems) and came across a concept I couldn't quite wrap my head around: <strong>soundness</strong> and <strong>completeness</strong>.</p>&#xA;&#xA;<p>I'm taking a class, and according to my instructor:</p>&#xA;&#xA;<blockquote>&#xA; <p>Soundness is an anal...
logic programming languages type theory
1
Soundness and completeness w.r.t. programming languages -- (logic programming languages type theory) <p>I'm studying programming languages (more specifically type systems) and came across a concept I couldn't quite wrap my head around: <strong>soundness</strong> and <strong>completeness</strong>.</p>&#xA;&#xA;<p>I'm ta...
habedi/stack-exchange-dataset
101,063
Finding shortest path between two nodes with a set of forbidden nodes
<p>I have undirected and unweighted graph, in which I would like to find the shortest path between two entered nodes. There is also a set of forbidden nodes. How to find the shortest path, if I am allowed to visit <strong>at most</strong> one node from the set of forbidden nodes?&#xA;<a href="https://i.stack.imgur.com/...
graphs shortest path
1
Finding shortest path between two nodes with a set of forbidden nodes -- (graphs shortest path) <p>I have undirected and unweighted graph, in which I would like to find the shortest path between two entered nodes. There is also a set of forbidden nodes. How to find the shortest path, if I am allowed to visit <strong>at...
habedi/stack-exchange-dataset
101,066
Tracing a polynomial algorithm for the problem of maximum-weight independent set
<p>It should be a very easy question, but I am a little bit confused.&#xA;According to <a href="https://cs.stackexchange.com/questions/47251/party-optimization-maximum-weight-independent-set-in-a-tree-graph">party optimization</a> post, the Maximum-weight Independent Set for trees can be found in the poly-nominal time ...
algorithms graphs
1
Tracing a polynomial algorithm for the problem of maximum-weight independent set -- (algorithms graphs) <p>It should be a very easy question, but I am a little bit confused.&#xA;According to <a href="https://cs.stackexchange.com/questions/47251/party-optimization-maximum-weight-independent-set-in-a-tree-graph">party op...
habedi/stack-exchange-dataset
101,082
Calculate the number of cycles of a Cactus graph?
<p>Considering a cactus graph <span class="math-container">$G = (V, E)$</span>, defined as:</p>&#xA;&#xA;<blockquote>&#xA; <p>A graph is a cactus if every edge is part of at most one cycle.</p>&#xA;</blockquote>&#xA;&#xA;<p>There is a way to calculate the number of cycles in this graph given only <span class="math-con...
graphs
1
Calculate the number of cycles of a Cactus graph? -- (graphs) <p>Considering a cactus graph <span class="math-container">$G = (V, E)$</span>, defined as:</p>&#xA;&#xA;<blockquote>&#xA; <p>A graph is a cactus if every edge is part of at most one cycle.</p>&#xA;</blockquote>&#xA;&#xA;<p>There is a way to calculate the n...
habedi/stack-exchange-dataset
101,091
MST Proof (Kleinburg & Tordos)
<p>Consider the Minimum Spanning Tree Problem on an undirected graph&#xA;G = (V, E), with a cost ≥ 0 on each edge, where the costs may not all&#xA;be different. If the costs are not all distinct, there can in general be&#xA;many distinct minimum-cost solutions. Suppose we are given a spanning&#xA;tree T ⊆ E with the gu...
graphs greedy algorithms minimum spanning tree
1
MST Proof (Kleinburg & Tordos) -- (graphs greedy algorithms minimum spanning tree) <p>Consider the Minimum Spanning Tree Problem on an undirected graph&#xA;G = (V, E), with a cost ≥ 0 on each edge, where the costs may not all&#xA;be different. If the costs are not all distinct, there can in general be&#xA;many distinct...
habedi/stack-exchange-dataset
101,104
Two's complement general formula
<p>In college, we've seen some general formulas to compute the decimal value a of a binary representation <span class="math-container">$a_{N-1} \dots a_2 a_1 a_0$</span> in two's complement, <span class="math-container">$N$</span> being the number of bits.&#xA;For <span class="math-container">$a \ge 0$</span> we've see...
binary numeral representations
1
Two's complement general formula -- (binary numeral representations) <p>In college, we've seen some general formulas to compute the decimal value a of a binary representation <span class="math-container">$a_{N-1} \dots a_2 a_1 a_0$</span> in two's complement, <span class="math-container">$N$</span> being the number of ...
habedi/stack-exchange-dataset
101,106
AVL Rotations Abbreviations
<p>I <a href="https://www.tutorialspoint.com/data_structures_algorithms/avl_tree_algorithm.htm" rel="nofollow noreferrer">read</a> that there are 4 types of rotations:</p>&#xA;&#xA;<ul>&#xA;<li>Left rotation</li>&#xA;<li>Right rotation</li>&#xA;<li>Left-Right rotation</li>&#xA;<li>Right-Left rotation</li>&#xA;</ul>&#xA...
terminology reference request binary trees avl trees
1
AVL Rotations Abbreviations -- (terminology reference request binary trees avl trees) <p>I <a href="https://www.tutorialspoint.com/data_structures_algorithms/avl_tree_algorithm.htm" rel="nofollow noreferrer">read</a> that there are 4 types of rotations:</p>&#xA;&#xA;<ul>&#xA;<li>Left rotation</li>&#xA;<li>Right rotatio...
habedi/stack-exchange-dataset