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
21 views

Merge sort code debugging

I am trying to write a code for merge sort. I am not getting the correct output. I am following this pseudocode link Following is my code. I pass my unsorted array into merge_sort function and call ...
0
votes
0answers
5 views

How to find whether two line segment(not two straight lines) intersect

I want to find a way to check whether two line segments intersects or not.I am using Xlib programming to implement this. I checked on internet but i only found the ways to find the intersection point ...
-7
votes
0answers
35 views

I need an algorithm that gives me as many completely unique sets of 6 as possiable from 60 units [on hold]

I need an algorithm that gives me as many completely unique sets of 6 as possiable from 60 units. I have a seminar that I want to seat 60 people and have them meet as many new people as possible in 7 ...
0
votes
2answers
33 views

element occuring maximum times in an array

I wish to find the element occurring maximum number of times in a large array in linear time. I was going through the moores voting algorithm page. ...
0
votes
0answers
5 views

Project X , which depth searching option to select for this use?

I am trying to ensure a global correct orientation of my normals. I.e make sure they point outwards everywhere. This is my method: 1.I have a coordinate list x y c n . At each point in coordinate ...
0
votes
0answers
13 views

Boolean OR and AND problems on CREW and EREW Prams

I am learning PRAM algorithms. As we can compute Boolean OR in O(1) time for CRCW PRAM by using following method. Let A[0]= A[1]|A[2]|A[3]...|A[n] is the Boolean OR of the n bits A[1..n]. Assuming ...
0
votes
2answers
65 views

Fastest way to find all primes under 4 billion

I'm trying to print every prime number under 2**32. Right now I'm using a bool vector to build a sieve and then print out the primes after making the sieve. It takes 4 minutes just to print out the ...
1
vote
0answers
11 views

Max K-product of the numbers

Task - Max K-product of the numbers Time Limit: 1 Memory Limit: 64 M Given a sequence of integers N (1 ≤ N ≤ 10 May, | A i | ≤ 2.10 9) and the number of K (1 ≤ K ≤ N). Find K sequence numbers whose ...
0
votes
1answer
90 views

Dynamic programming algorithm

Hi I have a question on a variation of an existing algo problem. Existing: Existing problem description: Generate 10-digit number using a phone keypad Therefore, if I have the 10 digit key pad and ...
3
votes
0answers
38 views

When given groups of numbers, how can I find the minimal set of groups to represent all the numbers?

When given groups of numbers, how can I find the minimal set of groups to cover all the numbers? The constraint is that the chosen groups should not overlap. For example, given three groups of ...
0
votes
0answers
56 views

I am trying to create a crossword-puzzle solver in java

I was trying to figure out how to create a puzzle solver in java on my own but got stuck. I was able to read in the input from a file where the dimensions of the crossword are stored in an array. I'm ...
0
votes
3answers
43 views

Get approximately evenly spaced integers, in a certain range?

I have an array of unknown length. I want to find five index values that are approximately evenly distributed along the array, and always include the first and last values. For example, if I have ...
0
votes
0answers
44 views

Data processing and algorithm

I'm stuck and in search of a methodical approach or an optimized solution for the following problem. I acknowledge it is bit lengthy and wanted to convey my aim to maximize clarity. I have an ...
0
votes
0answers
51 views

Finding subset of an array resulting maximum sum [duplicate]

This is an algorithm 101 problem: Given an array of N elements fund the subset of the array that results in maximum sum. For example if my array is {1, -3, 5, -2, 9, -8, -6, 4} then the answer should ...
0
votes
1answer
44 views

Optimal buying strategy with multiple shops and items

I'm working on a program to "optimally" buy magic cards. On the site each user has a "mini-shop", think eBay without the auctions. The users enters a list of cards he wants to buy, I then fetch all ...

15 30 50 per page