Is there a good algorithm I might apply to a DOM to lead me to groups of probably related nodes? The ultimate goal is to get something useful to assist extracting things like TOC's and "blog rolls" from websites. If something like this already exists, I'd be happy if someone let me know that as well.
I realize it's not something I can h...
I need help solving problem N from this earlier competition:
Problem N: Digit Sums
Given 3 positive integers A, B and C,
find how many positive integers less
than or equal to A, when expressed in
base B, have digits which sum to C.
Input will consist of a series of
lines, each containing three integers,
A, B and C, 2 ...
Hello All,
I was recently trying to solve some recurrence relations from CLRS and I noticed a strange nuance while solving these equations. I don't know if any of you guys have noticed it or not or may be the Theory champs can throw more light on this. (I too have a degree in CS but not in Theory!). While solving the recurrence for the ...
hi,
i am solving a system of ordinary differential equations using the odeint function. Is it possible (and if yes how) to parallelize easily this kind of problem?
...
Hey, right now I have implemented my own listener pattern.
I will send an update to the listeners using fast enumeration.
the code will look like this
- (void) updateListeners {
for (id<AProtocol>listener in _listeners)
{
[listener update];
}
and in listener, i implement method for AProtocol, which is update.
suppose there are n ob...
To make matter more specific:
How to detect people names (seems like simple case of named entity extraction?)
How to detect addresses: my best guess - find postcode (regexes); country and town names and take some text around them.
As for phones, emails - they could be probably caught by various regexes + preprocessing
Don't care about...
The actual question goes like this:
McDonald's is planning to open a number of joints (say n) along a straight highway. These joints require warehouses to store their food. A warehouse can store food for any number of joints, but has to be located at one of the joints only. McD has a limited number of warehouses (say k) available, and w...
This was a contest Q:
There are N numbers a[0],a[1]..a[N - 1]. Initally all are 0. You have to perform two types of operations :
Increase the numbers between indices A and B by 1. This is represented by the command "0 A B"
Answer how many numbers between indices A and B are divisible by 3. This is represented by the command "1 A B"....
Hey All
This is my first post, have been a lurker for a long time, so will try my best to explain myself here.
I have been using lowest common substring method along with basic word match and substring match(regexp) for clustering similar stories on the net.
But the problem is its time complexity is n^2 (I compare each title to all the...
I'm looking to build a pseudo Gantt chart, except one where events can be on the same line as long as they don't overlap, something like this:
M T W R F S U M T W R F S U M T W R F S U
Category 1: |Event 1| |Event 2| |------Event 3--|
|---------Event 4-----------| |-Event 5-|
I'm looking for an alg...
I'm looking for an example of how, in Ruby, a C like language, or pseudo code, to create the Cartesian product of a variable number of arrays of integers, each of differing length, and step through the results in a particular order:
So given, [1,2,3],[1,2,3],[1,2,3]:
[1, 1, 1]
[2, 1, 1]
[1, 2, 1]
[1, 1, 2]
[2, 2, 1]
[1, 2, 2]
[2, 1, 2]...
Problem
I want ot write a simple 1D RTS game and have the following path finding problem:
There are many one-dimensional lines and everywhere are teleporters which can be used to travel between the lines but also to travel inside the current line. The teleporters are the only way to travle between lines. What algorithm or pseudo code ca...
Hi there,
I subscribe to a data feed and from that create and maintain a structure using the index values on the INSERT/DELETE messages. I would like to ask the assembled cognoscenti whether they know of any algorithm which can deal with the piecemeal updates in an efficient way - generally batch-updates contain between two and six suc...
Hello all,
I am trying to use/implement a vector space model algorithm in Java to get the similarity score between two people based on its keywords. So I have the following classes:
Person - Has a List of keywords;
Keyword -
String text;
Integer score;
The keyword score is the number of mentions the person has made to the keyword.
...
I was asked about this question. I can only think of a O(nm) algorithm if n is the length of the 1st string and m is the length of the 2nd string.
...
My friend was asked a question in his interview:
The interviewer gave him an array of unsorted numbers and asked him to sort. The restriction is that the number of writes should be minimized while there is no limitation on the number of reads.
...
is there a way to dynamically add this whole adding process instead of the manually entering the values like a.Add("1 & 2"); and so on
by the way, this only happens if i select 5 conditions
-i am doing the adding base on the maximum condition i cater which is 5
the subsets that i show below must be in that pattern although its ok that ...
for
f = n(log(n))^5
g = n^1.01
is
f = O(g)
f = 0(g)
f = Omega(g)?
I tried dividing both by n and i got
f = log(n)^5
g = n^0.01
But I am still clueless to which one grows faster. Can someone help me with this and explain the reasoning to the answer? I really want to know how (without calculator) one can determine which one grow...
interpolation of bitmap:
I have bitmap of 16*16, i want to increase the size of the bitmap to 160*160, which is best interpolation type that can be suited.
...
Hello,
This is a problem I would think there is an algorithm for already - but I do not know the right words to use with google it seems :).
The problem: I would like to make a little program with which I would select a directory containing any files (but for my purpose media files, audio and video). After that I would like to enter in...