I have a list of (about 200-300) 2d points. I know needs to find the polygon that encloses all of them. The polygon has to be convex, and it should be as complex as possible (i.e. not a rectangular bounding box). It should find this in as low as possible time, but there are no restrictions on memory.
You may answer in pseudocode or any ...
Hi there
Suppose I have a database containing 500,000 records, each representing, say, an animal. What would be the best approach for parsing 140 character tweets to identify matching records by animal name? For instance, in this string...
"I went down to the woods to day and couldn't believe my eyes: I saw a giant polar bear having a ...
Given a sequence,say,
222
We have to put a '+' or '* ' between each adjacent pair.
'* ' has higher precedence over '+'
We have to o/p the string whose evaluation leads to minimum value.
O/p must be lexicographically smallest if there are more than one.
inp:222
o/p: 2*2+2
Explaination:
2+2+2=6
2+2*2=6
2*2+2=6
of this 3rd is lexico...
What could be the simplest and time efficient logic to find out the factors of a given Number.
Is there any algorithm that exist, based on the same.
Actually, my real problem is to find out the no. of factors that exist for a given Number..
So Any algorithm, please let me know on this..
Thanks.
...
Hi all,
I have an asp.net page that runs certain algorithm and returns it's output. I was wondering what will happen and how to handle a case where the algorithm due to a bug goes into infinite loop. It will hog the cpu and other sessions will be served very slowly.
I would love to have a way to tell IIS, if processing Algo.aspx takes ...
Is it possible to generate a musical instrument's sounds using only algorithms? or can it only be done via pre-recorded sound samples?
...
Just a curiosity question. Remember when in class groupwork the professor would divide people up into groups of a certain number (n)?
Some of my professors would take a list of n people one wants to work with and n people one doesn't want to work with from each student, and then magically turn out groups of n where students would be ma...
I am working on a project that involves searching for videos, these videos are tagged similar to how questions are tagged on stack overflow. I was wondering if anyone knows of a good 'tag-based' search algorithm.
Thanks!
...
The task is this: generate k distinct positive numbers less than n without duplication.
My method is the following.
First create array size of k where we should write these numbers:
int a[] = new int[k];
//Now I am going to create another array where I check if (at given number
//position is 1 then generate number again, else put thi...
What is the definition of an s2k algorithm? For example, "PBKDF2(SHA-1)" is an s2k algorithm.
Here is some Botan code that refers to s2k:
AutoSeeded_RNG rng;
std::auto_ptr<S2K> s2k(get_s2k("PBKDF2(SHA-1)"));
s2k->set_iterations(8192);
s2k->new_random_salt(rng, 8);
SymmetricKey bc_key = s2k->derive_key(key_len, "BLK" + pass...
I am working on address book synchronization algorithm. I would like to reuse some code if there exists, but couldn't find one yet.
Does someone know about an algorithm that will tell me in numbers/float/procent how much two names are identical. Levenstein distance is not good in this approach, as names and our adddress books are matchi...
Since some time, I'm using an algorithm that runs in complexity O(V + E) for finding maximum path on a Directed Acyclical Graph from point A to point B, that consists on doing a flood fill to find what nodes are accessible from note A, and how many "parents" (edges that come from other nodes) each node has. Then, I do a BFS but only "act...
This is the max searching algorithm diagram:
So, I wonder how can draw diagram for HaNoi Tower program:
package tunl;
public class TowersApp {
static int n = 3;
public static void main(String[] args) {
TowersApp.doTowers(3, 'A', 'B', 'C');
}
public static void doTowers(int n, char from, char inter, char to...
I have this code for Jaro-Winkler algorithm taken from this website. I need to run 150,000 times to get distance between differences. It takes a long time, as I run on an Android mobile device.
Can it be optimized more?
public class Jaro {
/**
* gets the similarity of the two strings using Jaro distance.
*
* @param s...
I have a map where I'd like to perform a call on every data type object member function. I yet know how to do this on any sequence but, is it possible to do it on an associative container?
The closest answer I could find was this: Boost.Bind to access std::map elements in std::for_each. But I cannot use boost in my project so, is there ...
Hi,
I am supposed to implement Dynamic programming algorithm for Stereo matching problem. I have read 2 research papers but still haven't understood as to how do I write my own c++ program for that !
Is there any book or resource that's available somewhere that I can use to get an idea as to how to start coding actually ?
Internet sea...
I'd like to get some community consensus on a good design to be able to store and query word frequency counts. I'm building an application in which I have to parse text inputs and store how many times a word has appeared (over time). So given the following inputs:
"To Kill a Mocking Bird"
"Mocking a piano player"
Would store the fo...
Laying out the verticies in a DAG in a tree form (i.e. verticies with no in-edges on top, verticies dependent only on those on the next level, etc.) is rather simple without graph drawing algorithms such as Efficient Sugiyama. However, is there a simple algorithm to do this that minimizes edge crossing? (For some graphs, it may be imposs...
The problem of finding the intersection/union of 'N' discs/circles on a flat plane was first proposed by M. I. Shamos in his 1978 thesis:
Shamos, M. I. “Computational Geometry” Ph.D. thesis, Yale Univ., New Haven, CT 1978.
Since then, in 1985, Micha Sharir presented an O(n log2n) time and O(n) space deterministic algorithm for the disc...
Short descriptio:
Need hashing algorithm solution in php for large number of text values.
Long description.
PRODUCT_OWNER_TABLE
serial_number (auto_inc), product_name, owner_id
OWNER_TABLE
owner_id (auto_inc), owener_name
I need to maintain a database of 200000 unique products and their owners (AND all subsequent changes to owner...