instruction
stringlengths
35
29.1k
I understand how radix sort works and how to implement it, but I don't understand why it works. Are there any underlying mathematical or logical principles that it relies on?
Name a data structure that you could use to implement a queue such that all of the standard queue operations are O(1). If you are thinking of a data structure based on Python's built in list, you need to be more specific then just writing "list". O(1) is constant time and I know that you can use lists to replace using...
Suppose we have the language $ \overline L = \{x∈\{0,1\}*:x∉L\}$ And we know that $A ≤ HPL ≤ \overline A$ where HPL is the Halting problem. We need to state whether A is finite, countably infinite and whether $A$ and $ \overline A$ is recursive or not or re or not. We know that A reduces to HPL and HPL is re and t...
It seems that if we only have object-key cache then we won't have spatial locality and only temporal locality. I use memcached in a python application and that has only object-key pairs and no hierarchy. Is this observation correct and why don't object-key caches behave more like physical cache memories where the latte...
This is a question from a past paper. I am struggling to get my head around the concept of a PDA. I understand that it is a Finite Automaton with a stack but am stuck as far as answering questions like this one. Thanks.
I have been studying unification, especially nominal unification (paper) gets my attention. I read the theory and examples. But I am wondering that what kind of problems occur in unifications. For examples, The following examples are from nominal unification paper. (I write distinct bound variables, so easier to see th...
Let's say I want to define a function: This function multiplies an input by two, adds one to this integer, then divides it by two in that order. f represents the multiplication, g represents the addition, and h represents the division. Could I represent this as λx.fxgh, when explicitly defined with parentheses is shown...
I implemented my ANN using SKlearn module's class MLPClassifier. Fitting it on some data and testing it on a very specific subset of said training data, it gives a score of 1.0, but actually using the ANN to generate outputs for said testing data almost always gives incorrect output. What could be the possible reasons ...
Input: A set $N = \{1, \dots, n\}$, subsets/consecutive pairs $S_1 = \{1,2\}, \dots, S_n = \{n,1\}$ with associated costs $c_1, \dots, c_n \in \mathbb{N} \cup \{0\}$, and a subset $B \subseteq N$. Output: A collection $\mathcal{S} \subseteq \{ S_1, \dots, S_n \}$ that minimizes $\sum_{S_i \in \mathcal{S}} c_i$ and cove...
I'm having trouble coming up with a 5-state DFA that, on all inputs of length 8, recognizes the string 00001111 and no other string (of length 8). The DFA must have an exiting transition for every symbol in the alphabet (namely {0, 1}). The behavior on input of other lengths does not matter. A 6-state solution is prett...
I am having a bit of trouble wrapping my mind around what a ranked binary search tree is and why having a rank is important. I am hoping that someone can clarify a few things for me. What I have looked into: From what I have read, a ranked binary search tree is a tree where each node has a variable "rank" attached to i...
Question: Suppose you launch a job on 10,000 machines in your own data centre. The job is slow to start because all the machines are trying to load the same large executable file. Name two networking technologies you could use to distribute the file faster, in addition to storing it on more replicas. Explain why each is ...
I understand that many algorithms have space/time tradeoffs-that is, to run faster, you can do things like caching data, which reduces time taken in exchange for space consumed. Given conservation of energy and spacetime equivalence, is there any relationship between the time saved by using extra space and vice versa? ...
I have always tried to understand the difference between all the above, but I always ended up being confused. The field I am referring to is cryptography in particular, but I guess this question is valid for all of computer science. Is there a proper way to understand and differentiate them all? -- In my notes so far: ...
A Horn clause is a disjunctive clause of literals containing at most one unnegated literal. Examples are $$ \neg p \lor \neg r \lor \neg q,\\ \neg s \lor q,\\ \neg s \lor \neg q\lor r,\\ s,\\ \neg r \lor t,\\ \neg q \lor \neg t\lor p. $$ Determining whether or not a set of Horn clauses is simultaneously satisfiable tak...
I need to create a correct evaluation of the method I'm proposing. The problem is that in the field I'm working on there is no benchmark that I can use for this purpose. On the other hand, my method has to run, as much as possible, on top of "real documents", but these documents are mostly private and created by indust...
Let $x_i,x_{ij}\in\mathbb{R}$ and $b_i\in\{0,1\}$ for all $i,j\in\{1,2,\ldots,n\}$ and $j>i$. I want to know which of all the possible boolean combinations make(s) the following expression maximal: $$\sum_i b_ix_i+\sum_{j>i}b_ib_jx_{ij}$$ I can think of greedy heuristics (for example, identify the $x_{ij}<0$ and then s...
I was wondering if this is true. I already proved that it is true for regular languages and I assume it is similar in context free languages (correct me if I am wrong), but what about languages in R that are not context-free?
def f(n): i = 2 while i < n: print(i) i = i * i I evaluated an expression that becomes something like 2^n or 2^2^n and set that equal to when the loop breaks or (2^2^n ) (>=)n but can't figure out how to get a runtime. Can someone show how to do complete this analysis and get a runtime?
I have two problems, one of which is solved using dynamic programming. I showed that it is NP-complete (a knapsack variant), therefore having this dynamic programming solution says that this one is weakly NP-complete. Right? Then, in the second problem I have added a new dimension to the problem which makes is more com...
Visibly pushdown automata [1] are pushdown automata in which input symbol determines whether push or pop operation happens in the stack. Does anyone aware of tight lower bound for their emptiness checking complexity? [1] Rajeev Alur and P. Madhusudan. 2004. Visibly pushdown languages. In Proceedings of the thirty-sixth...
Problem description I am trying to understand the first example of Big-Oh notation in Computational Complexity:A Modern Approach page 9. If $f(n) = 100nlogn$ and $g(n) = n^2$ then we have the relations $f = O(g)$, $g = Ω(f)$, $f = o(g)$, $g = ω(f)$. I understood why $f = O(g)$ and $f = o(g)$ . As for the rest I didn't...
Can someone please show me examples of what is the difference between OLR (one literal rule) and PLR (pure literal rule) using the DPLL algorithm?
Alan Turing states that, there can't be a program that can decide if a program will ever stop. But with such advances in AI, won't computers will be able to analyze code and decide like humans on whether a program will halt or not. Am I missing something in his claim? Or is it too fictitious?
Given: Collection $C$ of Subsets of a finite set $S$, positive integer $K <=|C|$ Problem Statement: Is there a collection $B$ of subsets of $S$ with $|B| = K$ such that for each subset $c$ in $C$, there is a sub-collection in $B$ whose union is $c$ ? This Set Basis Problem is NP-Complete. If we enforce an additional c...
I am interested in some kind of algorithm to achieve this. Basically here is the regular expression aa*(ab+ a)* and I want to construct a regular grammar for this. How I can achieve this ? Following are some correct regular grammar for above expression :- S-->aAB A--> epsilon | aA B--> epsilon | aB | abB S-->AB A-->a...
Given an acyclic undirected graph alike to this one : (Here the center is the node '2', and the radius is 5) What is the most efficient (ideally in O(n)) way to compute the radius of the tree ? I've already used different methods like : Computing the eccentricity of every node, and retrieving the minimal value (the ...
Is it possible to reverse engineer sorting algorithm (sorting by comparisons) by sequences of indices of compared elements? We can input any lists of numbers arbitrarily many times. Comparison to existing algorithms and their corresponding sequences is not allowed. Further tests can alter algorithm, so task can be rest...
How many bits we can negate using two/three NOT gates ? I am newbie at this subject so I ask for help. It is about circuits. Edit After reading link given in comments by @D.W I think that I can negate bits without NOT gates. I know that it is impossible, however I don't know where I am wrong. Simply, I can sort...
This Question is taken from the book Neural Networks and DeepLearning by Michael Nielsen The Question: In a single-neuron ,It is argued that the cross-entropy is small if σ(z)≈y for all training inputs. The argument relied on y being equal to either 0 or 1. This is usually true in classification problems, but for other...
I was trying to solve problems in max flow algorithms. And I came across this MIT Lecture Quiz. http://people.csail.mit.edu/moitra/docs/6854hw4.pdf solution : http://people.csail.mit.edu/moitra/docs/6854hw4solns.pdf Questions : (a) In any maximum flow, and for all vertices v and w, either the amount of flow from v to w...
I'm coming to Computer Science from Mathematics and am familiar with the idea of building classes of objects using Propositional Logic. Namely, start with some universe of objects, define some proposition $P \left( x \right)$, and then iterate over the universe of objects, applying $P \left( x \right)$ to each; keep th...
I'm coming to Computer Science from Mathematics and am familiar with the idea of building classes of objects using Propositional Logic. Namely, start with some universe of objects, define some proposition $P \left( x \right)$, and then iterate over the universe of objects, applying $P \left( x \right)$ to each; keep th...
Given a un-directed weighted graph G=(V,E) where V is the set of vertices and E is the set of edges between vertices, and weights are the time delays on each link between two user. The goal is to construct a multicast tree T (that connects source node to a set of nodes say K) such that to minimize the maximum (longest)...
What does the symbol $::$ mean in the following statement? $\forall{x}\in K :: x \longrightarrow x$ A cycle in a graph is a path that starts and ends on the same node. Clearly, if nodes in K lie on a cycle, then $\forall{x}\in K :: x \longrightarrow x$. Look at page 56 in the following. https://books.google.co.in/books...
Let $f$ be some function in some programming language (like C), and we need $n$ bits to store this function. Suppose we have some fixed value $v$ for the argument, then let g() { f(v) } be the function with no argument which just calles $f$ with $v$ as an argument. Then we need $n + |v| + C$ bits to store it, where ...
How to do or implement Lambda Calculus in a Rewriting systems? Rewriting systems are Turing complete. But I can't figure out how to do lambda calculus or functions with them.
I've been given a set $S$ of natural numbers (non-negative integers) $s_1$, $s_2$,...,$s_n$ where $|S|=n$. My problem is to figure out if there is way to get a total sum of 0 when using all the numbers of $S$ but we get to "choose the sign" for each number: that is, for $s_i$ we get to choose if we're going to add or s...
I'm wondering about the time complexity of writing a number as power of 2's. For example writing $n=218$ as $2 + 2^3 + 2^4 + 2^6 + 2^7$. It seems to me that we do $\lceil \log_2n \rceil $ divisions. Each division costs $O(n^2)$ so an upper bound is $O(n^2 \cdot \log_2n)$. However, this seems like a very loose upper bou...
It has been my understanding that, technically, our computers are Finite State Machines. And, since FSMs halt when they run out of input, the halting problem is technically solvable. At some point, we must reach an identical state without consuming input if there is an infinite loop. I also understand that doing this...
Using the diagram of a binary tree and algorithm answer the following: If the following commands store(1,laurence), store(1, ron), store(1,graham), store(1,abe) and store(1,martin) are executed what will be stored at location (3)? ron abe graham empty The answer is ron but I am struggling to work out why. How does t...
Given the recursive function: ($c$ is a constant) $\qquad T(n) = \begin{cases}1 & n ≤ c\\2T(f(n)) + 1 & n > c\end{cases}$ I need to find a $f(n)$ such $T(n) ∈ Θ(log^4 n) = Θ(\log \log \log \log n)$. I tried the iteration method, and it gave me $\qquad 2^i*T($$f1$($f2$(...$fi$($n$)..$))) + i $ which revealing the pretty...
Synopsis Imagine the secretary problem, except the goal is to hire two secretaries with the greatest possible difference between the two. The Problem I'm not particularly comfortable with this type of math so below are the modified constraints. The original constraints are from Wikipedia's page on the secretary proble...
Suppose there exists an algorithm that solves 3SAT in a polynomial number of steps. However, this algorithm requires some 'tuning' parameters, and the value of these tuning parameters take an exponential number of steps(given the input) to determine. Would this place 3SAT in P? (since it can be solved in polynomial ti...
I've seen scattered references to typed assembly in high assurance literature, but I don't really understand the advantage. If the compiler/runtime are capable of passing the types down to the CPU, then aren't they are capable of emitting equivalent checks in assembly? Bloating an instruction set with high-level primi...
Is there a good (perfect) hashing algorithm for the following problem? We have $n \ll m$ (say $n=150$ and $m=5\times 10^{12}$) and we want a hash table to store integers up to $m$ whose prime factors are all smaller than $n$.
I've been given this exercise as homework but I'm hard-stuck on it for a few hours now. Basically what I need to show is that cross correlation of 2 vectors of size n and m, for m <= n, can be computed in O(n*log(m)). say |x| = n, |y| = m. I tried computing (∗R) because its the same vector with a shift of indexes. I ze...
How can a operating system run on more than one CPU architecture? Does the OS detect what type of architecture it is currently running on? If so, does it simply use a different set of code for that architecture? How does the CPU detect the type of architecture?
The Chinese Postman problem (A.K.A Route Inspection Problem) I'm trying to match pairs of odd-degree nodes in a grid-graph representing an indoor map to ensure the graph is Eulerian (consists only of nodes with even degrees). My plan is to form a matching between the odd-degree nodes and consider Euler paths of the gr...
I've been reading the decidablity and undecidability chapters in Sipser's "Intro to Theory of Computation" however I could not find an explanation on the existence of a language that is both non-context free and decidable. The only reference to this was a simple language hierarchy diagram showing where the decidable/r...
There is as input a set of $m$ sequences of length $n$. I thought it was pretty straightforward at first that the time complexity of the algorithm provided below is $O(m^2n^4)$ but then it occurred to me that the time taken depends on the length of a LCS such that the longer a LCS relative to the input length the short...
Suppose we have a System F term $f : \forall \alpha. \alpha\times\alpha\to\alpha$, interpreted in a parametric model which is a bicartesian closed category. I was wondering if in such context it is possible to prove that (in the model) $f$ must be a projection (either $\pi_1$ or $\pi_2$), exploiting the naturality of $...
Where is the difference between a "meta model" and "design patterns"? If you take, for example, Fowlers "Identity Field" from his book "Patterns Of Enterprise Application Architecture": Why is this a pattern and not a meta model? Thanks!
I'm not an instructor. I'm a student doing such course. And I'm just trying to figure out what to do, because we're not given an input language. What kind of (input) language would you suggest for an University compiler project? It's a project typical to the compiler course in CS programs. However, I've been confused...
I am trying to use BNF to describe its own grammar to get used to it. What I can not find any information about is whether BNF must consist of zero or more rules or one or more rules. The difference would be: <grammar> ::= <grammar> <rule> | <rule> vs. <grammar> ::= <grammar> <rule> | "" The only difference I can see...
How am I supposed to perform this subtraction? For instance: $01110000_2−11101011_2$ $01110000_2$ has a positive sign, so there is no need to perform two's complement. $11101011_2$ has a negative sign, so I need to perform two's complement. Two's complement for $11101011_2$ is $00010101_2$ Finally, I must perform the s...
In step 6 of the Christofides algorithm it is implicitly suggested that there is an invarient that the euler circuit can always be shortcutted to an hamilton circuit, what exactly assures us that? e.g (let u,v,w be vertices in the graph.) in the euler circuit, if vertex v has already been visited once, and is being rev...
The data pages that are actually modified need to be copied. This approach, called copy on write, improves performance by reducing copying. According to me it is unnecessary as every process has its own data. (not sure) A third process working with that data is really not possible. Please tell me if it's possible, if p...
Let $L=a(a+b)^*b$, a regular expression. I will try to build the automaton by the $a^{-1}L$, $b^{-1}L$ rule $a^{-1}L = \{a,b\}^* b=M$. $b^{-1}L=\emptyset$. $a^{-1}M=b\cup\{a,b\}^*b=N$. $b^{-1}M=\{\varepsilon\} \cup \{b\}\cup \{a,b\}^*b = P$ But why are the result of 3 and 4 when doing $a^{-1}M$ and $b^{-1}M$ as given...
I'm trying to figure out the regression equation for the 0-1 Knapsack problem recursive algorithm: // Returns the maximum value that can be put in a knapsack of capacity W int knapSack(int W, int wt[], int val[], int n) { // Base Case if (n == 0 || W == 0) return 0; // If weight of the nth item is mor...
I want to iterate through the numbers $0,1,2,\dots,n-1$ in some order, where each number in the sequence differs by only one bit from the previous bit. I'm going to be using each number as an index into a matrix, and each index must be in the range $0..n-1$. Gray codes look useful. The problem is that standard grey c...
I'm doing C programming stuff, and I'd like to know little bit about memory management - My problem is that I'm not understanding where the computer (or the OS or the programs) stores the information related to allocated space and how the unallocated space information is processed and how it is reported as a runtime er...
For any language $L \subset \Sigma^*$, define $S(L)$ to be $$\{x\in L \mid \neg \exists y \in L: \exists z \in \Sigma^*: (z \ne \epsilon) \land (x=yz) \}$$ Show that $S(L) = S(S(L))$ I'm confused about the question here. The way we define $S(L)$ takes elements from $L$ $(x \mid x \in L)$, but $x=yz$ and $y \notin L$. ...
I'm stuck on "For any language $A$, let $A^R = {w^R | w \in A}$ Show that if A is regular, so is $A^R$." According to my research (see references), the steps required to prove this question, are: Reverse all the links in the automaton Add a new state (call it $q_s$) Draw a link labeled with ϵ from state $q_s$ to ever...
In his 1959 paper, On Certain Formal Properties of Grammars, Chomsky defined a "regular" grammar as a specific form of a type 2 (context-free) grammar. (See Definition 8 of that paper.) He then goes on (in Section 6) to demonstrate that regular (type 2, context-free) grammars can generate more languages than type 3 (fi...
I have a fairly simple real-valued genetic algorithm that seems to work fairly well, however it currently has some issues that I'm hoping to get some help with. If we consider a 1-dimensional problem, I use the following method to produce 3 children/offspring $(c_{1,2,3})$ from 2 parents $(p_{1,2})$: $$c_{1} = 0.5p_{1}...
OddPath be a set of all G, s, t, such that G is a directed graph with a path from node s to node t, and the shortest such path has odd number of edges. How can I show OddPath is NL? I think about it for a long time, the main problem is that I don't know how to get length of the shortest path in non-deterministic log pl...
What's the complexity of inserting an integer $n$ to an empty hash table? My guess is that it's $O(\log n)$ as we require to scan every bit of $n$ to compute its hash. However, I often see it as $O(1)$. Am I mixing up things here ?
Generally, I want to use the diagonal argument to prove it. I tried to define a language $A$ which is constructed by a Turing machine $D$: It will only take a input which has a form of a Turing machine $\langle M\rangle$ (the description of $M$) and simulate $M$ on $\langle M\rangle$. If it halts in polytime and accept...
I've been learning about NP-Complete problems, and came across the rectangle fit problem. Basically, the rectangle-fit problem is the problem of whether or not a set of 2d rectangles can fit in a larger 2d rectangle. What I have not been able to find, or solve myself, is what a possible solution looks like. Say there ...
By dynamic array, I mean an array that when it becomes full we replace it with a new array having greater capacity than the previous array. I read in a textbook that doubling the size of the array is the most efficient resizing. I want to know if this is in fact demonstrably true and not just a matter of personal prefe...
I'm looking for hints on the following exercise from Introduction to Automata Theory, Languages and Computation by Hopcroft and Ullman. Let $G$ be a grammar where all the productions are of the form $A\to xB$ and $A\to x$, where $A$ and $B$ are single variables and $x$ is a string of terminals. Show that $L(G)$ can be...
How do we count the numbers of traingles (i.e., different triads of vertex $u,v,w$ such that edges $u-v,v-w,w-u \in E$ ) in a given graph $G$? It is obvious that it can be done in $O(N^2)$: is there anything better?
I read in a book that the Intel 80286 microprocessor has an addressing capability of 16 MB. Does this mean it can process 16 MB of data at a time? Please explain what is actually meant by addressing capability.
I found one interesting point in nominal unification. Just after proposition 2.16 of Nominal Unification by Urban, Pitts, and Gabbay, it said the following, which I found confusing: For non-ground terms, the relation $=_{\alpha}$ and $\approx$ differ! For example, $a.\!X=_{\alpha} b.\!X$ always holds, whereas $\emptys...
I was reading about the Logic Theorist proving many of the Whitehead and Russell's Principia's theorems. However, I cannot find any technical explanation on how the program proved those theorems and specifically what method did it use to solve the Pons Asinorum. I'm interested in understanding how "independent" it was ...
I have a data set to which I want to apply logistic regression. I set my cost function to be $J(\theta) = -\frac{1}{m} [\sum\limits_{i=1}^{m} y^{(i)} log{(h_\theta \cdot x^{(i)})} + (1-y^{(i)}) log(1-h_\theta(x^{(i)}))$ and I am running gradient descend algorithm. When I plot the cost function as a function of the num...
We all know the structure of a binary tree: struct binary_tree { binary_tree *parent; int data; binary_tree *left; binary_tree *right; }; So a doubly linked list has the following structure: struct linked_list { linked_list *prev; int data; linked_list *next; }; But a binary tree can a...
Related to linear regression with noise I've been given the following functional, depending on the function $h$: $$ E_{out}(h) = \int \int (h(x)-y)^2 dx dy$$ I want to prove that the function that minimizes $E_{out}$ is $$h^*(x) = \int yp(y|x)dy$$ But I don't have any math tools to do it. Which things should I know to ...
This is my understanding: There are two types of processes: user and kernel(OS). Each process can have single or multiple threads. The threads of a user process are called a user-level thread and the threads of a kernel process are called kernel-level threads. Scheduler, dispatcher etc. contains kernel-level threads. B...
I want to approximate the output of a Monte Carlo simulation that takes a probability density function sampled at x-axis points $0,1,2,3,\ldots,n$ and outputs what tends to look like a dampened harmonic oscillator. Four examples appear below. The blue dots are the sampled pdf (or pmf), and the heights of the black lin...
Let's consider two-head (and two tapes) Turing machine. Let some problem $P$ be decidable in $LOGSPACE$ on that machine. What about complexity of that problem on the normal Turing machine ( one head, one tape?) I asked that question because I am thinking of some problem- I have to be able to get value of $i$-th cell bu...
Let's consider the following situation: We have a problem $\mathsf{L\text{}}$ . We would like to solve it in $LOGSPACE$. Let assume that our problem $\mathsf{L\text{}}$ can be divided to two parts: $A$ and $B$. We can solve $A$ using computatation model $M_1$ in $LOGSPACE$. We can solve $B$ using computation model $M_...
Is is decidable whether 2 given PDAs accept the same language? Also, is it decidable whether the language accepted by a given grammar is context free (the given grammar could be unrestricted but there may exist an equivalent CFG for it)
I'm trying to run Gensim's LdaModel on a corpus. I load the corpus myself from two XML files. I made a class to iterate over the text pieces in the XML files. It converts every text piece to a BOW using a dictionary I built using the XML files. This all works, I've checked that. I then use this iterator to train an LDA...
The Completely Fair Scheduler executes the task that has so far received the least share of CPU time and is thus the most 'disadvantaged'. So if a task sleeps for a really long time, say 3hrs, how does CFS prevent this task from being executed for the next like 3hrs (to adapt its CPU share to the much larger values of ...
I'm asking the question on the behalf of my classmates. We have a trouble about parallel programming that we can't comprehend threads, semaphores, forks and etc. We have been taking third time the course called as system programming. The instructor of the course goes with Unix, C and POSIX standarts. There are some boo...
Let say I have a directed graph G with positive edges and I create a new graph, G', by replacing the weight of each edge by the negation of its weight in G. If for a given source vertex s, I compute all shortest path from s in G' using Dijkstra’s algorithm. Will the resulting paths in G’ be the longest (i.e., highest c...
I am studying about set cover problem and wondering that which problems in real world can be solved by set cover. I found that IBM used this problem for their anti-virus problem, so there should be many more others that can be solved by set cover.
Given a matrix of size m x n, I am trying to traverse it using BFS from top left corner to bottom right corner. Instead of using a normal queue for BFS, I am using a min heap. For each cell, I am inserting the adjacent values (top, left, right, bottom) in a min heap. I am specifically trying to understand how big the ...
I was going through Andrew S. Tannenbaum's computer networks book, and on page 206 of it, he has derived the number of check bits needed to correct single bit errors. The derivation goes as follows: For m data bits, there are 2^m legal messages. Each of these messages has n illegal codewords at a distance on 1 from it....
Does $LL(K)$ grammar has one to one correspondence with $DCFL$ ? If I am understanding right, then the given statement says that $2$ distinct $LL(k)$ have one to one mapping, i.e they should not generate the same $DCFL$. Let us say:- $G1 : S-> aB,B->a$ generates $aa$ and $G2: S->aa$ also generates $aa$. Here, both ...
I want to build an adder in logisim only with 2-input-NAND gates. The adder consists of 2 inputs (1 x constant 1 and 1 x arbitrary number) and an output. The first thing which came into my mind is a 8-bit full adder but maybe there is an easier solution for this (because of the constant 1). Has anyone an idea? THX
How is the search for the item supposed to find the specific item if the data is all clumped together and all the search is given is the output of the hash function. I don't understand how it knows which of the pieces of data is the one that corresponds to the key if linear probing has been used so it could be any of a...
This is a research problem and I am just wondering if there is any already existing answer in any computer vision related paper that may have skipped my notice since this is not my active area of research. Imagine you have a shape. Now there is a large class of algorithm in existence collectively known as visual descr...
By the statement of the question i am trying to generalize the structure of the array.for me Being at their correct position means they can't be shifted. I tried to come up with a few examples and deducted such an array has to be 2-sorted or all the sorted elements are in the first half. for a k-sorted array we can use...
When we solve the recursive functions using substitution method, the impact of ceil and floor functions is trivial when the size of the input is large enough. For example the answer of $$ T(n) = T(\lceil n/3 \rceil) + O(n) $$ is equivalent to $$ T(n) = T(n/3) + O(n) $$ when the $n$ is large enough. Since $$ T(n) = T(\...
My processor noted that an infinite number of processors will allow me to test how much speedup I can achieve. I am not exactly sure how this applies. For instance, let's say I have a program that takes $1000$ seconds to execute and is broken into 4 phases(A, B, C, D). If two of the phases are $50%$ parallelizable an...
I'm reading a book on data structures and there is a comparison between linked list, array and dynamic array. The parameter name is wasted space. Here are the values: \begin{array}{cc} \text{Linked list} & O(n)\\ \text{array} & 0 \\ \text{dynamic array}& O(n) \end{array} What is the wasted space para...
I have the following table that compares different operation complexities for a linked list and array: Linked List | Array | Dynamic Array Deletion at ending O(n) | O(1) | O(n) Insertion in middle O(n) | O(n) | O(n) Deletion in middle O(n) |...