Questions tagged [algorithms]
In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning.
2,209 questions
1663votes
11answers
854kviews
Which hashing algorithm is best for uniqueness and speed?
Which hashing algorithm is best for uniqueness and speed? Example (good) uses include hash dictionaries. I know there are things like SHA-256 and such, but these algorithms are designed to be secure,...
1vote
1answer
158views
Data structure for grouping strings in a collection when they share common substrings [closed]
I am looking for a data structure and an algorithm to manage a dynamic collection of strings, but grouping strings that have a substring in common. I try to describe it through an example. @Christophe:...
0votes
2answers
367views
How to translate points on a path relative to two other points?
I'm trying to make a curved line move relative to the movement of a straight line. I'm thinking that I want the points on the curved line to keep their relative positions to the two points on the ...
30votes
7answers
17kviews
How can lossless compression ever exist?
If all data is essentially just a bit string, then all data can be represented as a number. Because a compression algorithm, c(x), must reduce or keep the same length of the input, then the compressed ...
-2votes
1answer
163views
algorithm needed for historical backups
I back up important paths from my PC each day with an automated process that creates zip files. On the 20 terabyte drive I can have close to three years worth. Each weekend I make a VHDX backup of my ...
5votes
9answers
3kviews
Methods to increase the amount of data sent in a packet
I have been working on launching high-altitude balloons (HABs, or weather balloons) and I have been using LoRa to enable long-range communication with my balloons. It's been great and pretty reliable, ...
6votes
7answers
7kviews
How to avoid repeating "a==b" when comparing "condition a" and then "condition b" and then...?
For example, I have an object: public class Obj{ public int a; public float b; public String c; } I need to find best "Obj": largest a and then largest b and then longest c: int ...
11votes
4answers
7kviews
Is there an algorithm for matchmaking?
I am interested to know if there is an existing algorithm to start a multiplayer game, for example, poker. What steps do we need to take when the player enters the "matchmaking phase"? I ...
41votes
10answers
17kviews
Difference between Algorithm and Code
A few days ago I had a conversation with a Civil Engineer with a background in Pascal and BASIC, and we talked about programming in Python. When I was talking, I used the term "code" to ...
-1votes
2answers
90views
Looking for clarification on the process of playing audio files [closed]
I've been working on a software project recently that's meant to include an audio player, and my plans for it definitely are to simply use an off-the-shelf player library, and go with that. However, ...
0votes
0answers
67views
approximating a shape with a line
I have an image that has been converted to an svg. The conversion looks fine, but it has prefered to use fill instead of stroke. This in itself is not a bad thing in terms of converting a raster image ...
2votes
2answers
562views
Is this architecture overkill? What is a good way to architect this software?
I have an algorithm I am trying to implement that has steps 1 to 5. There are several different ways I could implement each step. Each calculation step is essentially just an astronomy calculation, ...
151votes
13answers
18kviews
Is it just me or is this a baffling tech interview question? [closed]
Background I was just asked in a tech interview to write an algorithm to traverse an "object" (notice the quotes) where A is equal to B and B is equal to C and A is equal to C. That's it. ...
1vote
3answers
225views
Merge Sort Concept Understanding
Merge Sort contains basically two important routines: (i) split (ii) merge. I get the general idea. But I dont understand how this is more efficient than some random bad sort algorithm, like selection ...
2votes
1answer
502views
Algorithm for finding all combinations with constraints
I'm looking for a way in C# that finds all the possible combinations with constraints. I've got a list of machines. The machines have capabilities and limitations. I also have a document that defines ...