instruction stringlengths 35 29.1k |
|---|
Consider two bivariate polynomials of degree at most $n-1$ in each variable:
$$ F(x,y) = \sum_{i,j=0}^{n-1} f_{i,j} x^i y^j \quad \text{and} \quad G(x,y) = \sum_{i,j=0}^{n-1} g_{i,j} x^i y^j. $$
Show how to compute the product polynomial in $O(n^3\log n)$ time.
I know the product of two bivariate polynomials of d... |
As a starting point for this question, I came across this question, which AIUI is citing a construction showing how to simulate quantum circuits with a $PP$ algorithm, i.e. implying quantum computation in general is in $PP$.
However, it struck me as counterintuitive to say that the only way to implement a specific exa... |
I read about Why does a processor have 32 registers?, and others. Currently I am messing around with an OS in JavaScript, and wondering how many registers -- or more specifically, how many temporary variable slots -- you need in a computer. How many do you need? Bare minimum, what is theoretically the lower bound? Is i... |
I am far from being able to construct a meaningful test for this using godbolt or some C compilation tool. But basically I am wondering what it would look like to have deeply nested function calls, where each function had let's say a dozen temporary variables throughout. What happens to register usage? It seems like ev... |
How easy/difficult(in terms of big-O) is it to solve polynomial equations of high degrees of N?
Do apps like Desmos actually solve equations to get roots or do they approximate roots by iterating through a range of values for x?
What mechanisms are at play in solving a univariate polynomial equation algorithmically?
|
What is the max possible ratio between the tape alphabet size and the total encoding size in an asymptotic sense? Say if I take some TM and add more and more symbols to its tape alphabet, will the encoding size grow linearly? or might it grow exponentially? Or being more specific:
Let $L \subseteq \{ \langle M \rangle... |
Could someone explain me how to form a context-free grammar with all rules R by this example language, please?
\begin{equation}
L:=\left\{w c v c \overleftarrow{w} | w, v \in\{a, b\}^{+}\right\}
\end{equation}
The arrow over w means, that the word w is written backwards.
I already know that \begin{equation}
\Sigma=\{a... |
Why the first part of formula is equal to $2 * 2^2 + ... + 2^{log(n)} = 2^2 + 2^3 +...+ 2^{log(n)} = 2^3 +...+ 2^{log(n)} =... +2^{log(n)}$
What is the logic behind ($2^{log n +1} - 2{log n}$) ?
I don't understand why $2n.log - (2^{log (n+1)} - 2)=Θ(nlogn)$ ? (Please explain what is math logic bihind it)
|
I came across following facts:
Set of finite languages over a finite alphabet is countable.
Set of languages over finite alphabet is uncountable.
I believe proof of this will be similar to below fact number 3.
Set of languages over {0,1} is uncountable.
I came across proof of fact 1 here and of fact 3 here.
Sum... |
I have a data-set which contains more than two arrays. I would like to sort the data-set with out merging the arrays to a single array.
Arrays may or may not be in same machine. I am looking for an efficient way to sort the data.
|
If we have an algorithm that in polynomial time says if a graph G has an hamiltonian cycle, can we have an algorithm that in polynomial time find an hamiltonian cycle?
My attempt is to delete an edge of graph G and have G', after run the algorithm on G' to know if it has an hamiltonian cycle if not it means that the ed... |
The question, which I have slightly paraphrased to get rid of the fat, is this: There are $k$ areas of study in which you need to take 1 course. For each area of study, there is a set of courses $C_1,C_2,\dots,C_k$ that you have not yet taken. There are no conflicts between courses in the same area of study, but there ... |
Considering an undirected and unweighted graph, what's the best algorithm to find the shortest path between two vertices?
|
How to simplify this context-free grammar?
$$
S \to ACD \\ A \to a \\ B \to \varepsilon \\ C \to ED \mid \varepsilon \\ D \to BC \mid b \\E \to b
$$
Can the simplification result in this CFG?
$$
S \to AC \\ S \to A \\ A \to a \\ C \to E \\ E \to b
$$
|
If I have a NFA/DFA and I expect inputs of 00, 01, 10, 11 can I read input in groups of 2 binary digits at a time.
like the example shown
|
In heap (bubble down) we have the formula :
\begin{eqnarray*}
\sum_{i=1}^{\log n}(\log n - i)\times 2^i & = & \log n\sum_{i=1}^{\log n}2^i -\log n\sum_{i=1}^{\log n}i\times2^i \\
& = & \log n\times2^{\log n+1}-(\log n\times2^{\log n+1}-(2^{\log n+1}−2)) \\
& = & 2n−2\in Θ(n)
\end{eqnarray*}
Why we have $\sum_{i=1}^... |
I got stuck trying to prove that AND statement. I assumed that the TM will accept if its language is not empty and the complement of its language is not empty and reject if its language is empty or the complement of its language is empty. I tried reducing the Halting Problem but got stuck with proving that both the lan... |
Is there a functional problem for which there is an algorithm that can decide if a solution is a solution or not in polynomial time but we can't find a solution in polynomial time?
Let FP be the class of functional problems.
Update:
Every problem in FP, say $a$, has a correspondent decisione problem $a'$ (the associate... |
Suppose I have a collection of good convex sets and bad convex sets in $\mathbb{R}^d$ (where $d$ can be big). Each convex set is defined by a series of closed ranges in each dimension $d$ - a hyperrectangle if you will. For 2D an example set could be $\{(x, y) : x \in [1, 5]\wedge y \in [-2, 3]\}$. All sets are sparse... |
Suppose there is a directed graph $G=(V,E)$, with source $s$ and sink $t$, and I compute the max flow on it. Then I know that I can find a min-cut $(A,B)$, by letting $A$ be the set of vertices that are reachable from the source $s$.
My question is is this set $A$ the smallest possible $s$-component? I think it is.
To ... |
I was thinking about an non-deterministic algorithm to generate all the subsets of the $\{1..n\}$ set.
Subsets(n)
S' = null
for i = 1..n
u = choice(1..n)
if u in S'
fail
S' = S' + u
for_each u in S'
print u
How would I convert this algorithm into a determinis... |
I struggle to determine the runtime complexity of a function I thought of while trying to solve this LeetCode quiz. The quiz itself goes like this:
Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5.
For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15 a... |
I've seen a few lectures interchangeably use the two words (microinstruction and microoperation). I've found a source that explains the difference between a microoperation and microinstruction, but I have not been able to associate the two to a control word. Books I have referred to have provided definitions of each, b... |
Assume that problem A cannot be solved in O(n^2) time. However, we can transform problem A into a problem B in O(n^2 log n) time, and then solve B, and finally transform the solution of B into the solution of A in O(n) time.
Prove or Disprove: The above approach shows that problem B cannot be solved asymptotically less... |
i wonder: how can i find minimal distance of a self correcting code in following situation: if we know that a code can fix every 3 errors(if not more than 3 errors, the word is recovered) and can detect every 5 errors(if between 3 and 5 errors, the algorithm will report that the error can not be fixed), how can we fin... |
I was recently designing a Forth stack machine. I have an atomic instruction which rotates the top N elements.
For example if the top of the stack is on the left, then say the N=3 rotate instruction would do the following:
A B C D -> C A B D
A few more examples:
A B C D -> B A C D (N=2)
A B C D -> D A B C (N=4)
In ot... |
The usual criteria used to decide if a problem can be solved using dynamic programming is (1) if it has optimal sub-problems and (2) if it has overlapping sub-problems. Does the word "optimal" mean that DP can only be used to solve optimization problems? Otherwise, it would make more sense to write (1) as "if it can be... |
Let $\mathcal{F} = \{P_1, P_2,\ldots,P_m\}$ be a family of (closed) convex polygons in the plane, each represented by their vertices in (say) clockwise order. Let $n$ be the total number of vertices (you can assume general position, no two vertices are the same, no edges intersects a vertex other than its endpoints, no... |
Let $G$ be a $2$-regular graph. Each edge of the graph is labeled with either 0 or 1. Given a such a graph and a staring vertex $u$ and $l$ length string of 0 and 1, we have to follow the edges of the graph $G$ based upon given string. We can assume that a solution always exists.
What is the best algorithm for such pro... |
I have a function that is receiving messages with the following pattern:
(In this picture, "string" and "message" are synonymous.)
I'm only interested in the largest messages, such as these:
over a particular window.
Is there an algorithm that can appropriately filter the messages in the desired manner over a specif... |
I am referencing some code I found on GeeksForGeeks.com: Why is the current node printed (and processed) first before its children are processed? Wouldn't "breadth first" mean "Process children first, then process parent"? or, is that only for Trees? I can't be the only one to not understand this, so instead of flaming... |
I have heard a term "procedural algorithm" before so I'm curious what would constitute a non-procedural algorithm? Are there any examples?
As far as I understand, there are maze generation algorithms that generate mazes procedurally - randomly or pseudo randomly using a seed value of some kind. The opposite of that wou... |
Let $\Pi_{dec}$ be an NP-complete decision problem and let $\Pi_{opt}$ be its corresponding optimization problem. Assume $\Pi_{opt}$ can be solved in polynomial time.
What does this imply for $\Pi_{desc}$?
What does this imply for the class of NP-complete problems and the class NP, respectively.
I am not sure of my ... |
I'm trying to solve the following problem about arranging pens on rows. The problem goes as the following.
Given $n$ integers $l_1, \dots l_n$, the lengths of the pens, r rows and a goal G. Is it possible to arrange the pens where each row has a maximum length G, where G is the minimum possible.
I have shown that this ... |
I am wondering if I have quantity C of curved tracks and quantity S of straight tracks, how I could devise an algorithm, (computer assisted or not), to design a "random" layout using all of those tracks, such that the following rules are satisfied:
1) The tracks, when all connected, form a closed (continuous) loop for ... |
I know that Graph Isomorphism should be able to be verified in polynomial time but I don't really know how to approach the problem. Any help would be appreciated.
|
This and several other resources suggest to "Always a node that gets the middle key from bottom splits, should drop one item for a new middle key".
To illustrate with an example.
For 5-way B+-tree,
(24, 25, 44, 79) is one of the leaf nodes with its root being (..,24,80,...)
(..,24,80,...)
\
\
\
... |
I am able to form the regular expression but I am not confident with the grammar.
I have tried the following:
S-->aaaS|bS|b|lambda
Regular expression is given by:
b* +(ab*ab*ab*)*
Somebody please guide me.
Zulfi.
|
I have been working the last 8 years in try to convert from base n to base m without artihmetical operations.
My hypothesis is that by the same way that is possible convert bases without division (see the tables bellow.) based in a literal conversion.
Can you create an equivalence table that allow this direct translati... |
I want to compute the Hausdorff distance between two (very large) binary images X and Y, which is:
$$H(X,Y) = \max\left\{\,h(X,Y), h(Y,X)\right\}\!$$
with
$$h(X,Y) = \sup_{x \in X} \inf_{y \in Y} d(x,y)$$
$d$ being the euclidean distance (or any kind of distance, as it doesn't matter).
The naive algorithm for $h$, comp... |
Not after a specific answer, do following questions belong to same set of problem types?
Given n points in on 2D plane, find 4 or 5 , or m subset of points with less total distant to each other than all other points.
Or
Given n points in on 2D plane, count the number of triangles, squares etc. that they form.
Or
Given... |
In the second notes of MIT's Computer Systems Security class (6.858), there is this particular (slightly modified) snippet.
char *p = malloc(44);
char *q = p + 60;
char *r = q + 16;
// r is now at an offset of 60+16=76 from
// p. This means that r is (76-64)=12 bytes
// beyond the end of p. This is more than
// half a ... |
I have the exact same question as this guy, except I don't agree with the "verified" answer. Since in his answer the one to one mapping he describes depends on the input it makes the verifier $V'$ not a Turing machine (since it's now even worse than non uniform). If we only change the proof and the verifier in the triv... |
If P=NP, then every non-trivial language is NP-Hard, so clearly there are uncountably many NP-Hard languages. However it's less clear to me what the cardinality of this set is assuming P != NP.
|
NOTE: this is not an attempt to prove $NP \neq coNP$
There is one thing I have never been able to completely digest about the certificates of problems in $coNP$ and I would very much appreciate a definitive clarification from this community.
Let's focus on the subset sum problem ($SUBSUM$), now we all know that this pr... |
Suppose we have n food dishes associated to a cost c, and we have i guests such that each one of them has a certain number of preferences.
We want to choose a menu such that we minimize the cost and such that at least one preference for each guest is satisfied.
I implemented an easy greedy algorithm that orders eac... |
I know there is a post like this already posted, but I didn't quite understand the proof. Can someone explain it to me? Thanks in advance.
|
Given undirected and connected graph $G = (V,E)$.
Prove for any DFS run: for any $u,v \in V$ if $u.d>v.d$ then $u.d − v.d ≥ δ(u,v)$
$δ(u,v)$-distance of a shortest path (not necessarily unique) in G
$u.d,v.d$-time, when each vertex was discovered in DFS for the first time.
I know that DFS not necessarily returns the sh... |
Why can't we somehow represent it's negation in LTL and go from there? I think maybe because it has (effectively) two existential quantifiers, so negating it does not work. But how do I prove it?
|
I have a question relating to regular expressions that I'm a bit confused about, If someone can help me out, that would be very much appreciated.
Suppose there exists regular expressions R, S and T.
Then is R* ≡ R* R*?
I know the way to prove this is by showing that L(R*) is a subset of L(R*R*) and vice versa, but I ha... |
Choose some set in the natural numbers such that the language formed by the set under binary representation is a regular language, but is not regular under any other language formed by some base. Prove this using the pumping lemma.
I chose the set $S = \{2^i|i\in\mathbb{N}\}$. It is quite easy to prove this is a regula... |
As a part of my Distributed Systems course I am required to provide an algorithm that is able to elect a leader in a synchronous bidirectional ring, where every message that is sent may be lost (lets say with a probability p).
Furthermore, every node/process only knows its own ID, not the ring size nor its neighbors.
I... |
I was asked the following question in an interview.
Given an array $A$ with $n$ integers and an array $B$ with $m$ integers. For each integer $b \in B$ return and integer $a \in A$ such that $a \otimes b$ is minimum, where $x\otimes y$ for to integers $x$ and $y$ is the bitwise xor operation of $x$ and $y$.
For example... |
I have a problem that can be modelled by 15 undistinguishable balls to 21 boxes. The state of a node is defined by indices from 1 to 21 and corresponding values from 0 to 15, with the constraint that the sum of all values is 15. Those are the nodes of my (sparse) graph, the edges are defined by the rule: diminish the (... |
I am studying the proof of this exercise (link)
There exist N P-complete languages A and B such that A ∪ B is not N P-complete. Example:
$A = \{1x : x ∈ SAT\} ∪ \{0x : x ∈ \{0, 1\}^∗\};$
$B = \{0x : x ∈ SAT\} ∪ \{1x : x ∈ \{0, 1\}^∗\};$.
The languages A and B are N P-complete (prove it). On the other hand, A ∪ B conta... |
To clarify, by base representation I mean binary representation (ie. 101 = 5), ternary representation, etc.
Given the set $S$ of natural numbers such that $S = \{2^i| i \in \mathbb{N}\}$ prove that for some base representation of set $S$, the resulting language is not regular.
I have tried but I can't seem to figure ou... |
So, this problem is a kind of variant of polyomino packing which has been discussed frequently elsewhere, but I haven't been able to find anything on my particular problem. Suppose we have a list of polyominos $p_1, p_2, ..., p_n$ (not necessarily distinct), and we want to find a tiling of a rectangle of dimension $a \... |
Let's say I have 100 sets of values, and each set contains roughly 100,000 values. From these sets, I want to find the 10 sets that collectively have the largest number of unique values.
The brute force method of just checking all combinations is a combinatorial nightmare. I also thought about doing a rough approach ... |
Can anyone help :(
L = {ww^r | w element of (0,1)*}
Would it be like in :pseudo code, check if the string is equal to itself in reverse?
|
I am trying to solve the following calculation, but I can't find the suitable value for B.
6/3 (mod 6)
A= 3
B= ?
M = 6
(A * B) % M = 1
(3 * B) % 6 =1
Somebody please guide me what is the problem with this.
Zulfi.
|
I'm currently reading into complexity classes and one think will not fit into my head.
We are investigating NLogSpace with the Path/reachability problem.
There is a nondeterministic LogSpace algorithm which can solve reachability, but its inversion does not prove nonreachability because "it could miss a path". How is i... |
Let $A$ and $B$ be two arrays of size $n$ with positive integer values. Let $k$ be a given positive integer.
Design an algorithm to solve the following problem.
For each index $i$ ($1\leq i \leq n$) either select $A[i]$ or $B[i]$ but not both such that the total sum of the picked elements from each of the arrays is at... |
I am reading book "combinatorial optimization 3rd edition(Bernhard Korte、 Jens Vygen)".
(latest version is sixth.)
There are some discriptions in this book that I don't understand
Not all binary strings are instances of Hamiltonian Circuit but only those
representing an undirected graph. For most interesting decisio... |
Is there there a way to build a collection of universal hash functions $H=\{h| h:U\to D \}$ where the values of two hash functions are independent one from another? i.e., $\Pr_{h_1,h_2\in H}(h_1(x)=y \land h_2(z)=w )=|D|^{-2}$ for each $x,y,z,w\in U$.
Also, is there a term for such collection?
|
I found this solution online here, but I do not understand the logic behind transforming the instance of SAT to an instance of Exact Cover.
Here's the solution from the link (where C is the clause(s), A is the universe, and F is the subsets of the universe):
C1=(x1 ∨ x2) C2=(x1 ∨ x2 ∨ x3) C3=(x2) C4=(x2 ∨ x3)
A={x1,... |
Supposed we have a function $h:U\to [m_1]$. Given this hash function, can we generate without using randomization or a universal hash collection another hash $h':U \to [m_2]$, which depends on $h$ and the values of $h'(x)$ are uniform? i.e., for every value $y\in [m_2]$ we have $\Pr_{x} (h'(x)=y|h(x)=t)=1/m_2$ ($x$ is... |
Given some single variable linear functions $y_1=m_1x+b_1$, $y_2=m_2x+b_2$, $\ldots$, $y_n=m_nx+b_n$, the upper envelope is the function $f(x)= \max \{y_1, \ldots, y_n\}$. We know that this function is a convex piecewise linear function characterized by its breakpoints, where the slope of the function changes. I know ... |
Given the set of natural numbers, $S = \{2^i|i\in\mathbb{N}\}$ let $L$ be the language defined as the ternary representation of all numbers in $S$. How can you prove that this is not a regular language using the pumping lemma?
I cannot seem to find any sort of pattern for ternary representations of $S$, and so I'm find... |
I want to calculate a histogram from an array of size N. N is very large.
I know 2 ways to do so:
The naive approach is to find the maximum and the minimum in the first traverse and to split the range into equal bin ranges then to fill bins during the second traverse. However this approach produces degenerate histogra... |
I have the following situation:
(Alex, Bob)
(Alex, Charlie)
(Debra, Erika)
Imagine that each row in the list represents a friendship. Alex is friends with Bob. Alex is friends with Charlie. And Debra is friends with Erika.
I would like to figure out how many independent friends groups there are. So if someone is a frie... |
Let $G=(V, E)$ be an undirected graph with vertex set $V$ and edge set $E$. Let $V'=\{v_1, v_2, ..., v_k\}$ be a subset of $V$ where degree of each $v_i$ is bigger than or equal to $k$. Is there a way to check whether $V'$ is a $k$-clique more efficient than the brute-force algorithm in $O(k^2)$? Thanks in advance.
|
Let $G=(V,E)$ be an unweighted simple directed graph. Some of the edges are colored red. Let $E'⊆E$ denote the set of red edges. Given a vertex $s∈V$,suggest an efficient algorithm for finding the length of a shortest path from $s$ to every other vertex in the graph, fulfilling the following condition: the path include... |
Let $Σ =\{\textbf{[},\textbf{]},\textbf{,},\textbf{0},\textbf{1}\}$, and let $L⊂Σ^*$ be the language containing list representations of finite sets of binary strings: i.e., every string $x∈L$ is of the form $x= \textbf{[}x_0\textbf{,} x_1\textbf{,} \ldots\textbf{,} x_n\textbf{]}$, where:
for all $0\le i\le n$, $x_i$ i... |
Whenever I play a playlist of music using VLC (possibly other software too), I notice that some songs never get played while others get played repeatedly (even for a playlist of just 8 songs).
I know from my days as a computer science undergrad student that practical randomness is often good enough so we don't bother w... |
In my textbook, Operating Systems: Internals and Design Principles (9th Edition) by William Stallings in chapter 5, it explains how semaphores work:
The fundamental principle is this: Two or more processes can cooperate
by means of simple signals, such that a process can be forced to stop at
a specified place until i... |
I need to calculate $x^y \bmod 2^d$ in $O(d)$ summations/bitwise operations and $1$ multiplication by $y$. $x$ is restricted to be odd, $d\geq 3$.
$a$-bit arithmetic (for any $a$) is allowed, as this is just a theoretical question.
|
I have the following abstract data structure
Now i have to find a model that satisfies the principle of no junk and proof that
Could someone advise me to get to a solution and to understand the whole topic?
Thank
1 spec NatSet = Bool and Nat then
2
3 sorts
4 natSet = emptySet | add(natSet, nat)
5
6 ops
7 isEmpty: (nat... |
I was reading this article here: https://towardsdatascience.com/how-does-back-propagation-in-artificial-neural-networks-work-c7cad873ea7.
When he gets to the part where he calculates the loss at every node, he says to use the following formula:
"delta_0 = w . delta_1 . f'(z)
where values delta_0, w and f’(z) are those ... |
I'm learning for a test and I have some important questions about Computability of deterministic and non deterministic Turing Machines.
Consider we have the partial functions $f,g,h,t: \mathbb{N} \rightarrow \mathbb{N}$ with $f$ is Turing Machine computable, $g$ not Turing Machine computable, $h$ is not While solvable ... |
I have a directed graph G=(V,E) with a source s$\in V$ and a sink t$\in V$. There is a minimum capacity (lower bound) l $_{e}$ for each edge in G. There are no upper bounds on the edges.
In a course that I took, the professor told that to find a minimum flow -
1) We need to assign a large capacity to all edges and fin... |
Let $G$ be an undirected graph with each vertex labeled with an integer. Is there an algorithm to remove a subset of vertices such that in the resulting graph with deleted vertices no vertices with different integer labels are connected with an edge, but also among all groups of vertices labeled with the same integer, ... |
I'm giving a presentation where I have a single slide dedicated to formal languages. In this slide I give a simplified overview of the Chomsky Hierarchy and I'd like to give an example of a real world language for each tier in the hierarchy.
For recursively enumerable languages I've chosen C++ because in theory its te... |
What the recursive algorithm for moving $n$ disks says, is:
If $n > 1$, move $n-1$ discs from A to B.
Move the $n$th disk from A to C.
If $n > 1$, move $n-1$ discs from B to C.
Let $T_n$ be the number of moves for moving n disks.
We have
$
T_n=2T_{n-1}+1 , T_1=1 $, so $T_n=2^n-1, n \geq 1 $
Is it correct to say th... |
Give an algorithm to decide the following problem: given
a CFG $G$, does $G\Rightarrow^\star \epsilon$? That is, given a grammar can it
generate the empty word? How can I make sure my algorithm is decidable?
|
Suppose I trained a Gaussian process classifier with a linear kernel (using GPML toolbox) and got some feature weights for each input feature.
My question is then:
Does it/When does it make sense to interpret the weights to indicate the real-life importance of each feature or interpret at group level the average over ... |
Given a graph $G$ and integer $k$, find a vertex coverage set of size $k$ that is also an independent set. I need to either prove this problem is np-complete or find a polynomial solution. Any idea?
|
S -> AS | b
A -> SA | a
I get FIRST of S = {a,b} for S->AS
and FIRST of S = {b} for S->b
Hence FIRST(AS) ∩ FIRST (b) is not a disjoint
This is not LL(1)
But I checked this site http://smlweb.cpsc.ucalgary.ca/start.html
and this shows the grammar is LL(1).
Here I am confused!
Is it LL(1) or not?
|
I used IDA$^*$ for optimally solving the 8-puzzle and my friends used A$^*$ for it too (with same manhattan distance heuristic).
I calculated the average running time and number of nodes of my algorithm for 20 examples and my friend's algorithm. The time average for my algorithm was much faster than my friend's algorit... |
I'm reading the paper of Nicolas Ollinger on intrisically universal 1d cellular automata: https://arxiv.org/abs/0906.3213.
On page 3 (201), he gave the definition for mixed bulking quasi order. I'm unable to grasp the intuition behind such a defintion, injective universality seems to already capture what I can imagine ... |
Can someone please help me understand the main differences between a simple skiplist and an indexable skiplist? How does an indexable skiplist work in comparison to a normal skiplist (maybe a little example?), I can only find so little about it online.
Thanks.
|
We have the following recurrence $T$:
$$
T(n,k) = \left\{
\begin{array}{ll}
\alpha n^2 + \beta n + \delta & \quad \text{if }\; n \le k \\
T(\lceil n / 2 \rceil, k) + T(\lfloor n / 2 \rfloor, k) + \gamma n + \zeta & \quad \text{if }\; n > k \\
\end{array}
\right.
$$
for all... |
My understanding is that "maximum matching" (or "maximum transversal") are algorithms to pre-order matrix to increase the numerical stability. In Timothy Davis' book Direct Methods for Sparse Linear Systems, 2006, however, this algorithm is put in Chapter 7 which is titled "Fill-reducing ordering". In his more recent p... |
Interview question:
Given array A which contains only odd numbers and array B which contains only even numbers, explain
which sort algorithm would you choose.
I said merge sort. I thought that given two lists both of which are sorted (which I assumed) I can just merge them i.e use the merge part of merge sort.
I was t... |
Here we differentiate between the informative and non-informative packets. In FCFS, all packets are informative as they are sent in sequence, and so queueing delay rises with queue size. But i LCFS, once we sent a newer packet (newer in terms of packet generation times), all the packets that were generated after the ne... |
So here's the problem:
-You are given a partially filled grid of size mxn (represented by a matrix of 1s and 0s where a 1 signifies that grid square is occupied by a block and a 0 signifies that grid square is empty)
-You must minimize the number of empty grid squares by filling this grid with Tetris shapes which are e... |
I was requested to prove or disprove the following statement
if a graph is conncted does it necessarily means that E>(V-1)(V-2)/2
v represents vertex and E the edges
I think I need to disprove it with overall disproval but how?
|
I am working on a problem. I have been tracing much more simple problems by hand, but I got this one and I am truly at a loss. I do not know how to research this to help me figure it out. I am truly at a loss as to how to begin writing the message passing code to solve this. Any help on knowing how to break this proble... |
I have the following problem I am trying to prove NP Complete.
Tutors have two jobs- grading exams and homework help. Suppose we have a set of $n$ tutors. Each of them can tutor any amount of $m$ classes.
The tutors rent a large study room to offer help to students. But, note that ALL tutors for a specific class can't ... |
Suppose you have a weighted graph $G = (V, E \subseteq V^2, w \in E \to \mathbb{R}^+)$, where $w$ satisfies the triangle inequality $w(x, y) + w(y, z) \ge w(x, z)$. Suppose $k \in \mathbb{N}$ (in practice, $k \le 6$ is common). I want to find a set $C \subseteq \mathbb{P}(V)$ (a set of subsets of $V$) such that:
$\ma... |
I'm looking for an efficient way to assign n people to m rooms in a very specific way.
INPUT:
The program receives two sets of people (set of males and set of females), as well as a set of available rooms (rooms can have different sizes, ranging from 2 to 6).
ASSIGNMENT CONDITIONS:
The algorithm must assign people to t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.