An algorithm is a sequence of well-defined steps that defines an abstract solution to a problem. Use this tag when your issue is related to algorithm design.
0
votes
0answers
7 views
Minimal number of grid points to form cube with dual contouring? (voxels)
I have been learning about the dual contouring algorithm which is useful since it allows surfaces to contain both smooth and sharp edges. I am somewhat confused over how the input data is used. I ...
1
vote
0answers
16 views
Most performant way to convert a recursive hierarchy in MySQL to Core Data
I want to know if I'm better off using SQLite than Core Data for storing and querying a recursive hierarchy, simply to avoid time it takes to convert the sql rows to a Core Data store.
Here's a way I ...
0
votes
3answers
35 views
Algorithm to avoid duplicate Cards in Card Game
I made a rookie mistake, and am trying to figure out a fix without recoding the entire program. Here's the scenario:
I am creating 6 cards from a 52 card deck. The cards have 2 fields: int rank and ...
1
vote
1answer
49 views
How to find rank of an element in stl set in O(logn)
I want to find rank of an element in stl set. I am able to traverse from beginning to that element and find out its rank but that is taking O(n). Is there any method to find the rank in O(logn).
5
votes
2answers
33 views
Detect when a graph has been broken into two or more connected components
I have a computer science problem that I've been thinking a lot about lately, and I'd be interested to hear other people's feedback:
Let's say you have a 3d blockworld (like minecraft). The world is ...
1
vote
1answer
38 views
How to reduce set of points?
I have a ordered list of points(lat,long) on a route. I have a ordered list of stops (lat,long). Let's say I have 1000 points and 20 stops. I would like to reduce the 1000 points to something like 100 ...
-2
votes
1answer
53 views
Integer string compression algorithm
can someone please name an existing algo which is used for compressing numbers? numbers are integers and totally random with no spaces and decimals, eg. 35637462736423478235687479567456....n
well, so ...
0
votes
1answer
22 views
Transform XY plane entities to an arbitrary plane
I have a profile entity in XY plane. I have to do an extrusion along a vector. So I have to bring the profile entity perpendicular to the extrusion vector. Extrusion vector can be a arbitrary one ...
-10
votes
1answer
63 views
How much memory and time does the program take [on hold]
Here is method that preorders ordered array making 'slide' in the centre.Actually it doesnt matter how it works, just tell me please what is the complexity of this algorithm and how much memory is ...
1
vote
1answer
48 views
Method for interpret parameters
I'm building a program that requires the inclusion of some input parameters. This is a C++ example:
int main(int argc, char *argv[]){
if(argc == 1){
//Run programm without any parameter
}
...
1
vote
1answer
22 views
Algorithm to Convert text from Left Align to Justify
Recently I was asked in an Interview to design an algorithm to convert an input string which is Left Aligned (with spaces at the end of each line) into Justify (with no white space at the end of a ...
1
vote
1answer
31 views
Incremental Document Similarity Algorithm
I'm trying to calculate similarity between a large, dynamic set of text documents. For static sets, something like cosine similarity + tf-idf would work great. However, I'm looking for a scheme that ...
1
vote
1answer
47 views
obtaining time from clock cycles
I am running QNX,
I used a function to get clock cycles per second,
uint64_t clockPerSec = getCPS();
uint64_t currentClockCycle = getCurrentCycle();
functions
uint64_t getCPS()
{
return ...
2
votes
1answer
19 views
Topological sort to find the number of paths to t
I have to develop an O(|V|+|E|) algorithm related to topological sort which, in a directed acyclic graph (DAG), determines the number of paths from each vertex of the graph to t (t is a node with ...
10
votes
2answers
145 views
Algorithm to compute k fractions of form 1/r summing upto 1
Given k, we need to write 1 as a sum of k fractions of the form 1/r.
For example,
For k=2, 1 can uniquely be written as 1/2 + 1/2.
For k=3, 1 can be written as 1/3 + 1/3 + 1/3 or 1/2 + 1/4 + 1/4 ...