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
14 views
Calculation for Primes using square roots, and algorithm build inquiry
Below is a calculation for primes. I was trying to deconstruct it to get a better understanding of loops. Also, I would like to tweak this function to find primes by comparing a number to its square ...
3
votes
3answers
37 views
Calculating all possible combinations of a string, with a twist
I'm trying to allow a user to enter text in a textbox, and have the program generate all possible combinations of it, except with a minimum of 3 characters and maximum of 6. I don't need useless ...
0
votes
1answer
26 views
Max Heap in a subArray
I have the following Java Code that implements a max heap. It runs correctly,
List of numbers:
4, 1, 3, 2, 16, 9, 10, 14, 8, 7
MaxHeap result:
16 14 10 8 7 9 3 2 4 1
What I would like, is a change ...
1
vote
1answer
19 views
How to compute the time of an in-place external merge sort?
The original problem is like this:
You are to sort 1PB size of integers ranging from -2^31 ~ 2^31 - 1 (int), you have 1024 machines each having 1TB disk space and 16GB memory space. Assume disk speed ...
2
votes
4answers
51 views
Building a Matrix of Combinations
I am sure this has been asked a million times, but when I searched all the examples didn't quite fit, so I thought I should ask it anyway.
I have two arrays which will always contain 6 items each. ...
-2
votes
4answers
37 views
Algorithm for printing all possible 8 digit numbers [closed]
Do an algorithm for printing all possible 8 digit numbers requires 8 for loops? i.e 10 to power n time complexity. Is there a way I can reduce the number of loops?
0
votes
1answer
28 views
Algorithm to Calculate Density of Boolean Function
I'm trying to write a program that requires the calculation of a specific value dealing with Boolean functions. Given a single-output Boolean function f, given by a cover F, let's say I define the ...
1
vote
0answers
15 views
rendering algorithm suggestions
For a project in computer science I am to implement a further improvement to my ray-tracing renderer.
Features at the moment:
SIMD implementation of ray-triangle intersection
BVH using AABB. (SIMD ...
0
votes
0answers
13 views
How to treat uncolored edges in constructing fan in edge coloring algorithm
I have problems implementing Misra & Gris edge coloring algorithm. I have simple question - how to treat uncolored edges in construction of maximal fan?
Is uncolored a free color on all vertices, ...
0
votes
2answers
18 views
Input controls working simultaneously.how to update the values in one while another changes without making a loop?
I have two input controls working simultaneously, A and B. If A's value changed, B should be moved to that value.
If B changed A should be shifted to this value.
How do I setup the algorithm?
I ...
1
vote
3answers
42 views
Partial heap sorting to find k most frequent words in 5GB file
I know what algorithm I'd like to use but want to know what I'd have to change since the file is so large.
I want to use a hash to store the frequencies of the words and use a min-heap to store the ...
2
votes
0answers
29 views
CUDA dijkstra's algorithm
Has anybody implemented a CUDA parallelization version of Dijkstra's Algorithm for a given sparse matrix (cuSPARSE) graph, and for source, and target node, find the minimal K path?
I really need it ...
-5
votes
0answers
59 views
Authenticating my work [closed]
Ok guys I have an issue...just wondered if anyone can help me.
I'm currently at university, had to submit java coursework. Accidentally submitted it in the wrong format. (he wanted me to copy and ...
0
votes
2answers
48 views
Python- How can I speed up this code- geocoding cities through webqueries to database [closed]
I am currently iterating through a text file containing 30,000 French cities, geolocating them, and appending them to an output file. However, due to the enormous number of cities, this operation ...
-1
votes
1answer
18 views
insert events in to a calendar, no two events can take place in a week logn
Insert events in to a calendar, no two events can take place in a week, N is the number of events:
Insert in log N considering the week rule no two events in 7 days.
Given two days(x, y) inclusive ...