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.

learn more… | top users | synonyms (2)

0
votes
1answer
24 views

Need algorithm to draw overlapping rectangles

I need help with efficiently drawing/culling a series of opaque rectangles, in other words, this is a stack of index cards on a desk. The specifics are: no rotations, so everything is simple integer ...
0
votes
1answer
38 views

C++: Creating Polygons from images' transparency

Alright guys.. I'm at a loss here. I've been trying to code an image to polygon converter to no avail, it's really bugging me. It's supposed to create a polygon from the transparency of an image (the ...
1
vote
1answer
58 views

number of ways in Matrix

We are given a nxn square matrix with 0s and 1s. 0 means blocked cell and 1 means open cell where a robot can walk. If your robot is at (0,0) initially, what are the number of ways to reach (n-1,n-1). ...
0
votes
1answer
39 views

Threesum algorithm with Ruby

The question is - how many three numbers exits (of the provided) that sum to zero? I'm wondering, how to implement this brute force method (below) in ruby? The main aspect of this is : what is ...
1
vote
1answer
20 views

Draw a graph from a list of connected nodes

In a system I Have a list of nodes which are connected like in a normal graph. We know the whole system and all of their connections and we also have a startpoint. All my edges has a direction. Now I ...
3
votes
2answers
58 views

What are the other forms of evaluation besides a confusion matrix?

Homework I need an other form of evaluation besides a confusion matrix to visualize the performance of an algorithm.
3
votes
8answers
86 views

How can I tell if an array of integers is an alternating array?

I want to tell if an array of integers is alternating. in JAVA. For example: a[]={1,-1,1,-1,1,-1} --> true a[]={-1,1,-1,1,-1} --> true a[]={1,-4,1-6,1} --> true ...
2
votes
1answer
44 views

How to find all forward and cross edges in a graph

I know what is forward and cross edge. But I am finding difficulty in implementing them in program to find all the forward and cross edges in a given graph. Any help in this regard would be ...
0
votes
1answer
19 views

Sample data or corpora for testing text processing functions?

I'm wondering if there are online sample texts that can be used for testing algorithms. For example, I'm whipping up a simple tokenization function and want to make sure it works for special cases ...
-5
votes
0answers
41 views

Algorithm understanding [closed]

I am running a business and want to write a program in php and trying to create a user-friendly GUI in html but before that I need to create an algorithm I did it but I think its wrong so can you ...
3
votes
1answer
66 views

Graph algorithm to compute node values based on neighbouring nodes

I would like to make a graph algorithm that updates/computes the value of a node f(n) as a function of each of the f(n) values of neighboring nodes. The graph is directed. Each node has as initial ...
0
votes
0answers
23 views

Scraping algorithm for open graph in nodejs

I'm trying to get open graph metadata from an URL using nodejs (with cheerio), using the code bellow. I have this thing to fill: var result={}; for (var ogCounter = 0; ogCounter < ...
-1
votes
1answer
80 views

Finding matches between 30,000+ data sets

For simplicity sake, lets use a case example of 3 colors with corresponding numbers (there is actually 30,000+ different 'colors' and 254 different 'numbers' in real life though) Red - 0, 1, 2, 3, ...
3
votes
3answers
80 views

Weighted random sample in python

I'm looking for a reasonable definition of a function weighted_sample that does not return just one random index for a list of given weights (which would be something like def ...
-1
votes
3answers
55 views

Is there any way to split a number with multiplication of some prime number [closed]

I am looking for an algorithm which help me to split a number N as like that N = (p1a)(p2b).....*(pnz) where N is the given number p is prime numbers smallest to greatest a,b,..z are the power over ...

1 2 3 4 5 1580
15 30 50 per page