I know that Little's Law states (paraphrased):
the average number of things in a system is the product of the average rate at which things leave the system and the average time each one spends in the system,
or:
n=x*(r+z);
x-throughput
r-response time
z-think time
r+z - average response time
now i have question about a problem ...
Consider the deletion procedure on a BST, when the node to delete has two children. Let's say i always replace it with the node holding the minimum key in its right subtree.
The question is: is this procedure commutative? That is, deleting x and then y has the same result than deleting first y and then x?
I think the answer is no, but ...
Hello,
Let's imagine that we have high traffic project (a tube site) which should provide sorting using this options (NOT IN REAL TIME). Number of videos is about 200K and all information about videos is stored in MySQL. Number of daily video views is about 1.5KK. As instruments we have Hard Disk Drive (text files), MySQL, Redis.
Views...
I need to know details about LZMA compression algorithm. I know its general concept, but I need some examples explaining it in detail. Can anybody please help me to get more information?
Thank you.
...
for example i want create following matrix
http://en.wikipedia.org/wiki/Hilbert_matrix
i have only one question i want that matrix contan element like a/b form and not itself result it means that i want 2/5 and not 0 or 0.4 in case double please help
can i make it in integer array?
...
I need to calculate length of the object in a binary image (maximum distance between the pixels inside the object). As it is a binary image, so we might consider it a 2D array with values 0 (white) and 1 (black). The thing I need is a clever (and preferably simple) algorithm to perform this operation. Keep in mind there are many objects ...
Given a web log which consists of fields 'User ' 'Page url'. We have to find out the most frequent 3-page sequence that users takes.
There is a time stamp. and it is not guaranteed that the single user access will be logged sequentially it could be like user1 Page1 user2 Pagex user1 Page2 User10 Pagex user1 Page 3 her User1s page seque...
Hello guys!
Actually this is an interesting topic from programming pearls, sorting 10 digits telephone numbers in a limited memory with an efficient algorithm. You can find the whole story here
What I am interested in is just how fast the implementation could be in python. I have done a naive implementation with the module bitvector. T...
You are going on a one-way indirect flight trip that includes billions an unknown very large number of transfers.
You are not stopping twice in the same airport.
You have 1 ticket for each part of your trip.
Each ticket contains src and dst airport.
All the tickets you have are randomly sorted.
You forgot the original departure ai...
Hi guys,
I want to implement a media recommendation engine. I saw a similar posts on this, but I think my requirements are bit different from those, so posting here.
Here is the deal.
I want to implement a recommendation engine for media players like VLC, which would be an engine that has to care for only single user. Like, it would ...
I am wondering how I can find the number of intervals that intersect with the ones before it.
we want to know he number of pairs (i, j), with i < j, such that Internal i ∩ interval j = ∅.
For example for the intervals [2, 4], [1, 6], [5, 6], [0, 4], the output should be 2. from [2,4] [5,6] and [5,6] [0,4].
So now we have 1 set of inter...
I have a graph that starts off with a single, root node. Nodes are added one by one to the graph. At node creation time, they have to be linked either to the root node, or to another node, by a single edge. Edges can also be created and deleted (one by one, between any two nodes). Nodes can be deleted one at a time. Node and edge creatio...
Solve for s, and t1tn that minimizes the following summation:
nk = 1 (1 - min(stk,Ck)/max(stk,Ck)),
where
C1Cn > 1,
s > 0,
t1tn ℤ+
edit to clarify to problem description:
"how fast of an algorithm you require." Not super fast (But not multiple seconds). n will be around 5-10 or so.
As far as the actual problem, I have a numb...
What is the fastest sorting algorithm for a large number (tens of thousands) of groups of 9 positive double precision values, where each group must be sorted individually? So it's got to sort fast a small number of possibly repeated double precision values, many times in a row.
The values are in the [0..1] interval. I don't care about sp...
Hi,
I was wondering if anyone knows of any algorithms suited to fitting together N number of rectangles of unknown size into the smallest possible containing rectangle.
By optimal I mean with reducing the amount of white space left over in the resulting containing rectangle.
I would like to use this to generate css sprites from a ser...
I have four objects - for the sake of arguments, let say that they are the following letters:
A B C D
I need to calculate the number of variations that can be made for these under the following two conditions:
No repetition
Objects are position agnostic
Taking the above, this means that with a four object sequence, I can have only o...
You have an array size n and a constant k (whatever)
You can assume the the array is of int type (although it could be of any type)
Describe an algorithm that finds if there is an element(s) that repeats itself at least n/k times... if there is return one. Do so in linear time (O(n))
The catch: do this algorithm (or even pseudo-code) ...
I am looking for a practical visual programming environment based on Python. My primary application is algorithm development for processing remote-sensing imagery. I was initially inspired by LabVIEW from National Instruments, but that is more geared towards laboratory measurements and simulations. I write a lot of prototype code in P...
Hi guys,
A school project has me writing a Date game in C++ (example at http://www.cut-the-knot.org/Curriculum/Games/Date.shtml) where the computer player must implement a Minimax algorithm with alpha-beta pruning. Thus far, I understand what the goal is behind the algorithm in terms of maximizing potential gains while assuming the oppo...
Hi All,
I have two questions related to function objects and function pointers,
Question : 1
When I read the different uses sort algorithm of STL, I see that the third parameter can be a function objects, below is an example
class State {
public:
//...
int population() const;
float aveTempF() const;
//....