instruction
stringlengths
35
29.1k
I am given a set $A\triangleq\{1,\ldots,k\}$, an integer $s\leqslant k$, and non-negative integers $a_{ij}$. My problem is to find $s$ disjoint subsets $S_j$ of $\{1,\ldots,k\}$ such that: $\bigcup_{j=1}^s S_j=A$; and $|S_j|\leqslant a_{ij}$ for all $i\in S_j$ and $j=1,\ldots,s$. How to solve this problem? Is it har...
I have a dataset full of 0s and 1s, and when I visualize it with t-SNE, which does dimensionality reduction. There is clearly some structure in it as shown below. Each color corresponds to a particular category. There are 10 categories, and there are roughly 180 data points for each category. Each data point is a 64-di...
I have an odd PDA problem that I cant seem to construct. I haven't come across one like this before. $L = \{w\in\{a,b\}^{*} : 3\#_{a}(w) \leq 5\#_{b}(w) \leq 4\#_{a}(w)\}$ Could I get some pointers on how to tackle such a problem like this so I can be more familiar with the approaches here.
I'm learning the basics of grammars and compilers for a comparative programming languages class, but having a bit of trouble with one aspect of grammar derivation. Here is an example of a grammar derivation in a Youtube lecture I found. I get everything he covers here except that it isn't clear to me how a derivation i...
We have a set of $n$ elements which contains at most $\log n$ different numbers. I want to sort this set faster than $O(n \log n)$. Is it possible? I tried using a hash table to find the set of $\log n$ unique elements, then sort them in $O(\log n \log \log n)$, after that creating a new array of $n$ element with this...
Here's a problem that came up when organizing a party: You need to place $n$ guests in tables of size 10. Each guest has a list of $m$ other guests they'd like to have in their table. Find a seating arrangement so that the number of granted wishes is maximized. As many tables as possible should be full, i.e. at most on...
In multi core architecture, let us say we have M cores and N threads (N > M) and a process once assigned to a core can't migrate to another core's ready queue. We have to design scheduling policy to balance load. I read about this area and found this - 1) Block multithreading, Interleaved multithreading and Simultaneo...
How to construct regular expression for language L which contain all words in which there is a letter 'a' and the letter 'b'? Of course, I understand that it's easy problem but I just start to learn this science? Please, any advices and hints.
Firstly, which of the two diagrams below is the more accurate or more well-explained (if both are accurate) representation of the SSL process (at a beginner's level)? Diagram 1 Diagram 2 Also where does the "pre-master secret" in diagram 1, step 5 come from? I presume it comes from diagram 1, step 2? How is it create...
Given an array, if all the elements are distinct, can we find the count of elements which are lesser than an element and present to the left of that element in linear time if we have to do it for every element. I know this can be solved in O(nlogn) time by using self balancing trees, but I want to know whether we can s...
Does the following program $P$: a = 2 b = a + 3 c = a * b Satisfy the following formula? $$\{ \top \} \; P \; \{ a < (b - 2) + c \}$$ I want to use integers in $P$. The postcondition is satisfied, right?
I don't know how to solve this. The main thing I do know how buffers work but I don't know about display locations and lookup tables. A color frame buffer has 3 bits per display location and 6 bits per entry in three lookup tables. What is total number of colors in the palette from which this frame buffer has to choose...
I am having trouble understanding the proof of the theorem, which states that the greedy scheduling algorithm produces solutions of maximum size for the scheduling problem. The proof that I am referencing is here: Greedy Algorithm Proof I don't understand how the proof tells us to make the the problem smaller and small...
I see so many 8 Puzzle Solvers use a stack instead of a queue. Why is that? If you are looking for the solution with the fewest number of moves, wouldn't the solution be at a shallower point in the tree, meaning that BFS would find it much quicker? Is there some subtlety to the problem that I'm forgetting that makes DF...
I have 1 problem :--> L = { < M > | TM halts on no inputs } I have solved the above problems by reductions given in the book and even there are many links in stackexchange site. I have no problems in the reduction method. But, just trying to be more curious, I tried to solved these problems by using rice theorem. I kn...
While studying, I came across the following statements: A join point is a program point where two branches meet. Available expressions is a forward, must problem. Forward = Data Flow from in to out. Must = At joint point, property must hold on all paths that are joined. I get what joint point, available expression and ...
I was reading the paper _Efficient Inference in Fully Connected CRFs with Gaussian Edge Potentials (Philipp Krähenbül and Vladen Koltun, in Proceedings of 25th Annual Conference on Neural Information Processing Systems (NIPS), 2011 pdf), and I didn't understand this equation (eq 5) in the paper: I understand the first...
As Atm is recognizable, its complement cannot be recognizable, due to being so Atm would be decidable. I am trying to clarify if the problem P is the complement to Atm. If so, how could i approach the problem without looking at Atm to prove undecidability? My first thought was: H is a machine which solves P: H halts a...
I have found many proofs online about proving that a greedy algorithm is optimal, specifically within the context of the interval scheduling problem. On the second page of Cornell's Greedy Stays Ahead handout, I don't understand a few things: All of the proofs make the base case seem so trivial (when r=1). I don't und...
Let's say I have an NxN array if integers. I want to continually update it, but also continually query for the sum of an arbitrary sub-section. So example would be as follows: We start with a 3x3 array of all 0s. Operations: update 1,1 to 3 update 1,2 to 1 update 0,0 to 2 update 2,2 to 6 print sub-section starting at ...
The most trivial implementation of BFS would simply store the last frontier (open list), build the new frontier, and then replace the last frontier with the new (like in the example python code below). But almost universally, the first algorithm shown for BFS in textbooks is the queue-based implementation. What's the d...
Is there any way for solving the Knapsack problem when we are limited by several constraints? Let's assume that we have a set of items in which we have value v that we want to maximize and we also have two constraints weight and volume that must be lower or equal than the values W and V respectively. My question is, ca...
The full question is: Construct a Turing machine that recognizes the set $\{0^{2n}1^n \mid n\geq 0\}$. The Turing machine starts with the input on the tape and the head over the leftmost symbol of the input. The symbols to the left of the input are blanks out to infinity, as are the symbols to the right of the input....
I have some very simple doubt in definition of routing table, and would be thankful if anybody could clarify it. The doubt is that can the routing table of any node, say w, be smaller than the degree of w? In other words, to route packet from w to its neighbour, say y, is it required that there should be some entry cor...
In a traditional computer calculations are done with logic gates that check inputs with AND gates etc. But in a quantum computer, are calculations performed differently since the qubit can be in states other than 1 or 0? I understand that qubits can have values other than 1 and 0, however, before it is used as input in...
For an un-directed graph, how do I obtain all possible Minimum spanning trees? A graph is created with set of Vertices V, and set of edges E. In the below graph, we can see that there are two MSTs. I want to obtain all such MSTs (using any algorithm). I have currently tried to solve this using Kruskal's algorithm. But...
I'm reading CH Isomorphism. Let's divide into two stages: Prop corresponds to types. so a proposition A $\wedge$ B corresponds to type A $\times$ B. Proof corresponds to the program. What is the corresponding proof and program in this case ? As far as I can guess the proof is a pair but how we denote program ? Is...
In CH-I what the propositions A , B ranges over too ? An update : From Pfennings notes : "A denotes proposition about the mathematical objects such as integer or a real number." From : Per martin lof "On the meanings of logical constant" pdf cs.cmu.edu/~crary/819-f09/Martin-Lof83.pdf , 17-18 page "We may substitute ...
Shouldn't I post this question on mathematics.stackexchange.com? Let be an airlaine company which has to affect its aircrew to several flights. We group som flights in subset, every flights of a subset have to be realised by the same aircrew according to the actual possibilites and labour regulations. We provide a lis...
I am not sure how to approach this. L1 and L2 are using the same alphabet.
My competitive programming coach told me of a balanced binary tree used by a lot of Chinese competitors that has all the functions of any other balanced binary tree and is fully persistent and runs queries and updates in ${O(log^2N)}.$ What information is there on this tree, and does it go by a different, more popular ...
Preliminary definitions Barendregt [2004] introduces the following two definitions of substitution and their equivalence: Ottamnn variable convention (p. 26) 2.1.13. Ottamnn variable convention. If $M_1, ..., M_n$ occur in a certain mathematical context (e.g. definition, proof), then in these terms all bound variable...
I am working on a project where I need to be able to compute the maximum flow between two nodes in a graph after one of the edge weights has been incremented or decremented by 1. The graph is directed and edge weights are all integers. I can find the maximum flow the first time, by Ford-Fulkerson's algorithm or some va...
Let $R \in REG$. Is it true that if $F\cap R \in REG$ and $F \cap \overline{R} \in REG$ then $F \in REG$? I took $R = \Sigma^{\ast}$ and because $F\cap R \in REG$, $F$ must be regular. Is this the right approach?
I noticed that AND, OR, NOT those three logic gates are Functionally Complete, it means I can represent any trues table only by those three gates. A Turing machine may halt or not in a particular input but a combinational(not sequential) logic circuit always gives an output in a particular input. You may not agree with...
I'm taking online compilers course. It's long ended, so it wouldn't be cheating to ask a question on quiz here. Let $S_i$ be the string consisting of $i$ 0's followed by $2i$ 1's. Define the language $L_n = \{ S_i | 1 \leq i \leq n \}$. For example, $L_3 = \{\, 011,\, 001111,\, 000111111\; \}$ For any given $n$, what ...
If a NFA contains N states, then Equivalent DFA can have atmost $2^N$ states. Is there any method or any concept to know, how many final and non-final states will be there in the equivalent DFA ? Take for example : An NFA has 7 states out of which 3 are final states. Its equivalent DFA can have atmost 128 states. Then ...
I'm trying to prove that there exists an undecidable subset of {1}* by showing a one-to-one correspondence between it and {0, 1}* (which would imply a one-to-one correspondence between their power sets), but I'm struggling with how to do the one-to-one mapping. Isn't it just surjective? That is, there's one unary repre...
I want to build an expert system for analyzing the personality of a number of people and then distribute them in groups , each group will have members with different personalities. I have been reading about ES a lot but I still confused , does rule-based system enough to build the system, or do I have to use matching ...
Given this definitions about Types and Type systems : Types are described by means of a language of type expressions: Basic or primitive types: Bool, Char, Int, ... Type variables: a, b, c, ... Type constructors: → (function), × (tuple), [ ] (list), ... Rules to build type expressions: τ ::= Bool | Char | Int | ···...
Self-play seems to be very important for reinforcement learning algorithms. Can we train reinforcement learning algorithms without self-play (or learn mostly from past experiences)? For example, let's say that I want to build a TRPG AI, which involves natural language and physical interaction between heterogeneous play...
I am reading both recursive and non-recursive using stack methods to implement inorder, preorder and postorder traversal of a binary tree at https://en.wikipedia.org/wiki/Tree_traversal#Depth-first_search_2, which I also copied below. What confuses me most is that I find the non-recursive implementations using stacks...
The tag sampling tells me that, Creating samples from a well-specified population using a probabilistic method and/or producing random numbers from a specified distribution. Now, the question becomes: what is population then? Suppose, I am implementing a classifier. I have a set of training data in the file trai...
The report referred in the title is the following: A Block-sorting Lossless Data Compression Algorithm, by M. Burrows and D.J. Wheeler, SRC Research Report, 1994 The step I do not understand is step D3, on page 4: for each i = 0, ... , N - 1: S[N - 1 - i] = L[T^i[I]] Question is: why does this work, i.e. why does thi...
Well, it's not exactly a queue if it allows for random reads. This question is about a data structure which behaves like a queue for insertions and a sorted dictionary for reads. Imagine an algorithm that maintains a list of elements so that: It reads an element from the list based on its key. It then inserts that ele...
My recent question on Programming Puzzles and Code Golf got some fair attention and showed that not only it is very easy to output $10^{100}$ symbols and halt, but actually quite convenient in many programming languages as well. While posting it I was wondering whether I should ask for $10^{10^{100}}$ instead but decid...
Title pretty much states the question, I was looking for some assistance with the following: You are given a search string and a magazine. You seek to generate all the characters in a search string by cutting them out form the magazine. Give an algorithm to efficiently determine whether a magazine contains all the lett...
If I can use FIFO queue and read/write registers, can I reach wait free 2 set consensus if I have 3 processes? I thought is I can, but I saw a conclusion from text book says "we cannot achieve 2 set consensus on 3 processes in shared memory system", so I'm confused now.
If f(n) is the problem to determine the nth prime number, how fast can this be done, i.e. What is the fastest known algorithm to find the nth prime number? What are lower bounds for the time complexity?
Finding the minimum Steiner tree is well known NP-hard. It seems obviois that asking "find a Steiner tree of cost < K" has to be NP hard, because I could solve the original problem by repetedly calling an algorithm that solves the second. But is this "repeteadly call"/loop a valid reduction? There seems to be something...
Is there any tool for prototyping a programming language semantics and type system and that also allows for some sort of model checking of standard properties, like type soundness? I'm asking this, because I'm reading a book on Alloy and it provides the exact functionality that I want, but for models expressed using r...
In a simple graph $G$, what is the maximum bound for edges if we want shortest cycle stay at $k$. How we can find this bound for a graph? Have it any formula or technique to calculate it? thanks in advance
Let $G$ be a graph which is rigid and non-planar (e.g. $K_{3,3}$). Is it possible that $G$ has a planar cover? Are there any studies on this topic?
In this variance based k-clustering paper they claim that for a cluster with S points: $$|S|\sum_{i \in S}{\|x_i-\bar{x}\|^2} = \sum_{a,b \in S,\ a<b}{\|x_a-x_b\|^2}\,.$$ Why is that? can you please show me the derivation?
I've seen the topic of the automorphism group appear in several introductory graph theory books I've looked at. It always feel oddly disjointed and poorly motivated to me. Is there any practical (or impractical for that matter) applications of knowing the automorphism group of a graph?
I'm on a lambda calculus with parametric polymorphism a la Hindley-Milner Haskell-oriented course and I'm currently facing this exercise which I got stuck on. Prove that $(\forall m\downarrow, n\downarrow :: N)\space (m+n)-m=n$ Definitions: $(+)=\backslash m \space n \rightarrow case \space m \space of \space \{0\right...
I'm trying to understand Sipser's example showing that $ALL_{nfa} \in Co-NSPACE(n)$, where $$ALL_{nfa} = \{ <A> | A \text{ is an NFA such that } L(A) = \Sigma^*\}.$$ The algorithm can be seen here. I'm confused by a few things, but mainly what is meant by "nondeterministically select an input symbol"? If I "nondetermin...
I want to get an algorithm with $\theta(nlogn)$ time complexity that search for two elements in an array of integers, which their sum is equal to $x$ such that x is an integer and $n$ is array size.
I am trying to understand the proof of correctness for Dijkstra's algorithm (shown below) and also at the following link: CS Auskland Proof by contradiction Suppose that $u$ is the first vertex added to $S$ for which $d[u] \ne \delta(s,u)$. We note: $u$ cannot be $s$, because $d[s] = 0$. There must be a path from $s$ ...
I'm having trouble understanding the proof of the undecidability of the Halting Problem. If $H(a,b)$ returns whether or not the program $a$ halts on input $b$, why do we have to pass the code of $P$ for both $a$ and $b$? Why can't we feed $H()$ with $P$ and some arbitrary input, say, $x$?
In the set cover (SC) problem we are given a universe $U$ (a set) of $n$ elements and a collection $S$ of $m$ sets whose union equals the universe. The set cover problem is to identify the smallest sub-collection of $S$ whose union equals the universe. If I add the constraint that $m=n$ to SC, is this new problem sti...
Consider the basic non-recursive DFS algorithm on a graph G=(V,E) (python-like pseudocode below) that uses array-based adjacency lists, a couple of arrays of size V, and a dynamic array stack of size <= V. If I understand correctly, this is a cache oblivious algorithm since no information about the memory configuration...
I understand the basics of Skip Lists and their implementation also the basic Search Insert Delete functions and their run time complexity. Recently after a lecture, a professor proposed an interesting question. He asked what we suspected the total time building a skip list using randomization. A few hints were given:...
Brain-Flak is a minimalistic, stack-based, Turing complete, esoteric programming language. A big concern among Brain-Flak enthusiasts is a concept informally called "stack cleanliness". The basic idea for stack cleanliness is that only certain values on the stack will be edited and all other values will remain uncha...
I was learning Hidden Markov model, and encountered this theory about convergence of Markov model. For example, consider a weather model, where on a first-day probability of weather being sunny was 0.9 while that of being rainy - 0.1. The transition distribution probabilities were - probability of sunny on current day ...
I’m currently working on a finger exercise for mit6.00.2x, a MOOC in computaional thinking, and was having some issues. First of all: don’t worry, I don’t need you to do my homework for me, I just want to clarify an aspect of the question. So, the original question asked us to program the computer to find all subsets o...
Since machine language executes instructions on ALU, CPU register and memory, is correct say that machine code abstract the Von Neumann model? If exists, semantically, what is the relation between machine code and Von Neumann architecture?
On a Turing machine, the state changes during the execution of the program. Von Neumann architecture implements this machine theory and typical computer hardware uses Von Neumann architecture. Imperative programs uses the state to describes their computations. Semantically, is correct to say that imperative program wor...
Is there a generally accepted symbol for indicating instantiation. That is indicating an object is an instance of a class. My first guess is to use a left arrow with a double or triple line but this seems more like a functional programming symbol, based upon what I've seen of Haskell. Wikipedia has no examples and a qu...
Year 12 high school student here, but my ambition is set on Automated Theorem Proving. I wish to apply it to, of course, mathematics and computer science, and maybe if possible other applied subjects like physics, chemistry or even analytic philosophy. I have yet to go to university to do a bachelor degree in Computer ...
I was reviewing the post If $L$ is context-free and $R$ is regular, then $L / R$ is context-free? I completely understand why $L/R$ is context free. I just tried a different approach, which is not that rigorous according to the answers given. It is just based on the basic understanding. How I tried : Let $L = a^N b...
We have alphabet $\Sigma = \{ { a, b} \} $. How to construct CFG for language $\Sigma^{\ast} - \{a^{n}b^{n} | n \ge 0 \}$. I suggest that is very easy, but I can't invent. I know PDA for this language if it can help.
I am learning basic grammar and parsing concepts and ran into this statement: Nonterminal symbols represent syntactic entities: statements, declarations, or expressions. But the three terms (statements, declarations, expressions) were not really defined. I have plenty of programming experience so I have a fairly intu...
Show that $x^{3}$ = $O(x^{4})$ but that $x^{4}$ $\neq$ $O(x^{3})$.
Having learned a rough summary of Hoare logic (i.e. learning just the basic concept of Hoare triples and a few of the rules) I kept seeing a statement along these lines: The rule of consquence allows us to strengthen the precondition and weaken the postcondition. (paraphrased) What does it actually mean to strengthe...
Let $A = (Q,Σ,\delta,q_0,F)$ be an NFA such that $L = L(A)$. We define a DFA $A'=(Q',Σ,\delta,q_0',F')$ as: $$ Q'=2^Q, \qquad q_0'=\{q_0\}\\F'=\{q\in Q \mid q'\cap F \neq\emptyset\} $$ My question is how we know what elements $Q'$ has? What is the formal definition to obtain these elements? Because it can contain all...
Imagine a finite $n*n$ grid graph $G(V,E)$, much like a chessboard. Imagine further an undirected subgraph $H(V',E')$ of $G$. Let us call the squares of chessboard $G$ "faces". A DFS algorithm can detect a simple cycle in $H$ in linear time. However, such a search cannot efficiently find all simple cycles in $H$ as the...
In the section 6.2.3 (Volume 3) Donald Knuth says: ... we can ask about the number $B_{nh}$ of balanced binary trees with $n$ internal nodes and height $h$. It is not difficult to compute the generating function $B_h(z) = \sum_{n\ge0} B_{nh}z^n$ for small $h$, from the relations $$B_0(z) = 1,$$ $$B_1(z) = z,$$ $$B_{h+...
Let $\mathrm{SpaceTMSat} = \{\langle M, w, 1^n\rangle\mid\text {DTM $M$ accepts $w$ in space }n\}$. How do I prove that this language is PSPACE-complete? NP contains NP-complete problems and so does PSPACE. Am I supposed to prove it the same way as I would prove an NP-complete problem?
We have a graph with connections to vertices given to us. For example, consider that following pairs of vertices are connected: 1 & 2 2 & 3 3 & 4 4 & 5 5 & 6 Now the graph becomes 1-2-3-4-5-6. Maximum vertices I can drop such that atleast one of their neighbors is still in the set, is: 4. This is because I can drop al...
Sometimes I can see the recurrence relationship and other times I cannot. This is one of those times. I've gone through a few iterations of trying to solve it but I also find a set of values where my idea fails. If I go exponenetial I can figure it out... but that's a specific no-no. I'm good with nudges in the right d...
I am writing a genetic algorithm for Machine learning and came across Pittsburgh approach in some research papers. The papers didn't explain the algorithms proper or I am too stupid to understand. I know that each Individual contains set of rules and I have also implemented in binary but am having trouble with 6 float ...
What are sequences? How do we denote the numbers inside them? I know that in terms of computer science, a sequence of items is an array.
If I can assume that it is NP-complete to determine whether a set of objects can be packed into 2 bins, how can I prove that it is NP-complete to determine whether a set of objects can be packed into 3 bins? I understand that this is like the Knapsack problem, but I am having trouble going backwards essentially, since ...
I have a bunch of wmv files (~300), named the following way: video1.wmv -> videox.wmv. Some of these video files, are exact duplicates of one another (same format, same bitrate, same length, basically, they were copied and renamed, so the only thing that differs from them is their name). Is there any way to find out if...
So I was given this algorithm to compute the efficieny in which I found sorts an array into ascending order. solvethis(T[1..n]) for i = 1 to n-1 do //n minJ = i //n-1 minX = T[i] //n-1 for j = i+1 to n do //sum_{i=1}^{n} t if T[j] < minX then ** //sum_{i=1}^{n} t-1...
Statement comes from this answer. A blanket statement that this is a well-known fact is made in this other question. I have never heard of a language equation. But I am just a student. Given the syntax, is this equating the derivations of a CFG grammar to equations? In other words, is this bit from the answer $A=ABa$ m...
Since Turing machines has great influence on typical hardware architecture (Von Neumann) and both uses concept of state, is correct to say that an imperative program is analogous to how a Turing machine works? “Computability via Turing machines gave rise to imperative programming. Computability described via λ-calcu...
Consider the following unary operation on languages: min(L) = {x ∈ L | no proper prefix of x is in L} Prove that regular languages are closed under this operation; that is, prove that if language L is regular, then so is min(L). (hint: construct a DFA to accept Min(L) based on the DFA accepting L) After searching...
Say for an example,i have Color codes that are : A , B , C I want to repeat this colors so i ll put them as : 5A , 10B , 10C = 25 So now A will repeat 5 times ,B will repeat 10 times and C will repeat 10 times. Now i have 16 hands. in which i can allocate those colors.but problem is i can not allocate it more than 16 a...
I have the following homework problem, with given solution but I do not understand why certain choices in the solution were made as opposed to my own (incorrect) solution and I would like some clarification. The question is to compare the growth rates of several functions using o, O and $\Theta$. It is the first time ...
IBM is working on a neuromorphic computer, Synapse, intended for computation based on artificial neural networks. My question is, what makes these types of computers more efficient at processing neural network algorithms, compared to GPU's?
If we have a language $F$ and a regular language $D$ (a finite set) then can we say anything about the intersection of $D$ and $F$? Will the intersection of the languages be finite or regular? This question arises from another question which says Show that if $L$ is not a CFL and $F$ is finite then $L - F$ is not a CF...
First i began with the definition of $\theta$ as below: $c_1n \leq k \log(k) \leq c_2n \implies c_1\frac{n}{logk} \leq k \leq c_2\frac{n}{logk}$ and we also know if $k\log(k) = \theta (n)$ then $k = O(n)$ then $k \leq cn$ thus $c\frac{n}{logn} \leq c_1\frac{n}{logk}\leq k $ and thus $k = \omega(\frac{n}{\log(n)})$. In...
I am going through undecidability of TM and found this question $L=\left \{ \left \langle M \right \rangle |M\ is\ TM \ and \ number\ of\ strings\ in\ the\ language\ \ is\ prime\right \}$ I think it is decidable as number of strings in the language is prime ,i.e , 2,3,5,7,11,13,17,............. It seems to me like it i...
My question is N(a)=2N(b) ; No of a's = 2 * No of b's . So for every symbol b can I pop 2 a's simultaneously
In Sipser's text, he writes: When a probabilistic Turning machine recognizes a language, it must accept all strings in the language and reject all strings not in the language as usual, except that now we allow the machine a small probability of error. Why is he using "recognizes" instead of "decides"? If the ma...
Big data era, people say the big data systems must use the scalable data structures and store. I didn't get the point here. I need some examples. What are the good examples of (1) scalable and (2) non-scalable data structure respectively? Can any one give me an idea on it?
I will start of with an informal example and give a more formal problem definition later. Say I have a finite set of positive real values: $\{2.3, \pi, 4.382, 0.3\}$. Using normal addition and multiplication, we can construct expressions like $(\pi + 2.3) * 0.3 + 4.382$ and $(0.3 + \pi) * (2.3 + 4.382)$. We put the fol...
I am trying to find a solution better than O(n2) for the following problem: There are N points on a 2-D plane (N $\le$ 106), with integer coordinates between -105 and 105. Each point has an associated integer "reach radius" Ri (0 < Ri < 105). Build a directed graph (represented by adjacency lists) in which these poin...