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.

learn more… | top users | synonyms (1)

12
votes
4answers
535 views

Searching integer sequences

I have a fairly complex search problem that I've managed to reduce to the following description. I've been googling but haven't been able to find an algorithm that seems to fit my problem cleanly. In ...
11
votes
2answers
980 views

Converting a bounded knapsack problem to 0/1 knapsack problem

I ran across a problem where goal was to use dynamic programming (instead of other approaches). There is a distance to be spanned, and a set of cables of different lengths. What is the minimum number ...
10
votes
6answers
567 views

Examples of general purpose algorithms that have benefited from running on a GPU? [closed]

I am looking for examples of general purpose algorithms (meaning non-graphics related) that have been proven to run an order of magnitude faster on a GPU than on a CPU. I will use these examples to ...
8
votes
7answers
446 views

Refactoring While Programming

When posed with a problem, particularly when it is complicated in nature, I try to take some time to think about the approach I am going to take to solve the problem. Despite this, what often happens ...
3
votes
2answers
4k views

OCR - starting point [closed]

I really am a starter with OCR, and would like to implement an OCR system. Any pointers on where I can find the introductory material, with the programming kept in mind, like what algorithms or data ...
13
votes
6answers
482 views

When to prefer a generalized solution over solving specific cases

In programming we're often faced with a choice: cover each conceivable use case individually, or solve the general problem: Its obvious that solving the immediate problem is faster, however ...
11
votes
5answers
757 views

How to do TDD for something with many permutations?

When creating a system like an AI, which can take many different paths very quickly, or really any algorithm that has several different inputs, the possible result set can contain a large number of ...
10
votes
6answers
2k views

Is it inefficient to concatenate strings one at a time?

I recall back from my days of programming in C that when two strings are joined, the OS must allocate memory for the joined string, then the program can copy all the string text over to the new area ...
7
votes
3answers
354 views

Change of the complexity class through compiler optimization?

I am looking for an example where an algorithm is apparently changing its complexity class due to compiler and/or processor optimization strategies.
7
votes
2answers
2k views

B Tree compared to an R tree - Isn't it just a bunch of linked lists linked together?

I'm pretty familiar with a B Tree, mainly having to keep the databases well fed with electricity, air conditioning, and harddrive space. I associate with a double (doubl[ie,ey]?) linked list. Today, ...
6
votes
1answer
419 views

Why would I care about the asymptotic growth of the lower bound of the worst case time/space?

In mathematics, there are notations for asymptotic lower bounds, upper bounds, and tight (within-a-constant-factor) bounds. When describing the growth of functions in general, it makes sense that all ...
5
votes
3answers
307 views

Algorithm to pick user

I need an algorithm for picking a user. Users are identified by letter {A, B, C, ...} and are ranked by number {1, 2, 3, ...}. Rank is the degree of likelihood to be picked, so a rank 2 user is ...
5
votes
2answers
906 views

Algorithm for an exact solution to the Travelling Purchaser Problem

do you know of any algorithms which give an exact solution for the Traveling Purchaser Problem. I can only find heuristic and probabilistic approaches. I do have implemented a genetic algorithm so ...
5
votes
4answers
172 views

What are some common algorithm optimization opportunities - mathematical or otherwise

What are some common algorithmic optimization opportunities that everyone should be aware of? I have recently be revising/reviewing some code from an application, and noticed that it appeared to be ...
4
votes
4answers
419 views

Building a route creator

Ok, already up front, I'm going to tell you, that this is a bonus task for Data structure course I'm taking. That should take care of all the questions whether or not this is for a homework. Route ...
2
votes
2answers
243 views

Mutual exclusion over network - pattern?

I want to do the following: I have a number of computers. On each computer a programm will run. There is no centralized server. The program can choose by defined criteria to give another computer ...
8
votes
6answers
974 views

How do the algorithms to solve problems encountered in interviews translate into real world solutions?

I have recently finished an undergraduate course in computer science and I am looking for a job. During the search I encountered several interesting (and tough) problems that needed clever algorithms ...
7
votes
4answers
588 views

finding houses within a radius

During an interview I was asked given the following: A real estate application that lists all houses that are currently on the market (i.e., for sale) within a given distance (say for example the user ...
5
votes
9answers
2k views

Does object-orientation really affect algorithm performance?

Object orientation has helped me a lot in implementing many algorithms. However, object-oriented languages sometimes guide you in "straightforward" approach and I doubt if this approach is always a ...
5
votes
5answers
1k views

How do I go about data deduplication at scale?

I need to develop, or at least conceptualize a module that does efficient data deduplication. Say we have millions of data records already. Insertion of another 100 mn records, making sure that there ...
4
votes
2answers
556 views

How much logic can be put into an object-pooling factory class before it does more harm than good?

The main language I'm interested in doing object pooling in is AS3, which is known to need it in many cases. In the past I've always made a brand new factory class for every type I was going to try ...
4
votes
1answer
787 views

What is the difference between Quantum annealing and simulated annealing?

In both algorithms objective functions, that will be executed with non quantum computers, are used. Both algorithms are methods for finding the global minimum of a given objective function. From ...
4
votes
4answers
968 views

patented algorithm [closed]

What does it mean when an algorithm is patented? Am I allowed to use it as long as I am not making money out of it? I am asking because I am working on a project and I happened to discover a feature ...
3
votes
3answers
391 views

Is it better to use a switch statement or database to look through 5,000 to 10,000 instances?

I have some JSON data in this format (5,000 instances for now): {"id":"123456","icon":"icon.png","caseName":"name of case"} I am allowing the user to search for the name of the case and then return ...
3
votes
2answers
473 views

Programming interview: on sorted arrays, algorithm proof

The following is a programming interview question: Given 3 sorted arrays. Find(x,y,z), (where x is from 1st array, y is from 2nd array, and z is from 3rd array), such that Max(x,y,z) - Min(x,y,z) is ...
3
votes
2answers
453 views

Why hill climbing is called anytime algorithm?

From wikipedia, Anytime algorithm In computer science an anytime algorithm is an algorithm that can return a valid solution to a problem even if it's interrupted at any time before it ends. ...
3
votes
2answers
684 views

Product classifying algorithm - text classification - C# - algorithm suggestions

Alright people. Finally with the help of stackoverflow community i have gathered 20 commercial product selling websites product pages with the following features Product URL Product Price Product ...
2
votes
2answers
177 views

Graph traversal and filtering in indoor navigation and path finding

Which of the following options take less processing time/is less expensive in a graph traversal algorithm for a (indoor)navigation system? a) To produce all possible paths between start and ...
2
votes
1answer
322 views

Why create a Huffman tree per character instead of a Node?

For a school assignment we're supposed to make a Java implementation of a compressor/decompresser using Huffman's algorithm. I've been reading a bit about it, specially this C++ tutorial: ...
2
votes
3answers
111 views

Efficient Summary calculation method or approach?

I have an object hierarchy with a number of leaf nodes that will contribute to summary values for the parent object (specifically: project cost and square footage). What's the most efficient way to ...
2
votes
1answer
384 views

Closest location - Heapify or Build-heap

So lets say we have a set of gps data points and your current location. If asked to give the closest point to your current location we can utilize a heap with the distance being the key. Now if we ...
1
vote
3answers
876 views

How do I approach this PHP/MYSQL query?

I have a reservation system that I have coded and my final task is to allow the user to enter a set of dates and then show them all available options. The reservation table is set up with unit_id, ...
0
votes
0answers
52 views

Algorithm to calculate scheduling of task list, check feasibility [duplicate]

Problem I am trying to figure out how to best calculate a schedule as well as to check if for a set of tasks it is even possible to create a valid schedule for the following situation. Tasks have ...
0
votes
1answer
168 views

Designing online exam

I need to design an online exam server for an exam like GRE in which question difficulty increases if you answer correctly and decreases if you answer wrong. Questions are multiple choice ...
0
votes
1answer
95 views

fill containers with blocks of different sizes to have containers of “similar” sizes [closed]

I have a sorted list of blocks L that I want to put in 4 containers C, the containers have a size limit S. I want to have similar containers height, by similar I mean the size variance should be as ...
0
votes
3answers
248 views

How to create single integer index value based on two integers where first is unlimited?

I have table data containing an integer value X ranging from 1.... unknown, and an integer value Y ranging from 1..9 The data need to be presented in order 'X then Y'. For one visual component I can ...