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)

-1
votes
1answer
117 views

Looking for feedback on my approach to implement an algorithm [closed]

We've recently worked with a mathematician to build us an algorithm. The algorithm will look at click data and will continuously update data associated with the user, the content, and the content's ...
3
votes
1answer
272 views

What are the best algorithms out there to retrieve data from a file system?

This is my usecase: Traverse a filesystem, gauge its entire size and then upload it to Dropbox. Looks quite easy and is quite easy. Now if I do it using celery and spawn a thread for each ...
3
votes
1answer
241 views

OpenGL Image Load-Store Atomics Applications

I originally asked this on plain old stack but it was closed for being too open-ended. (Which was a good call as this is a better place for such questions.) Original Link: ...
2
votes
3answers
611 views

How do programs like subversion detect when a file has been edited as opposed to created/deleted?

This is my first question here so I hope it is not off topic. Although I am using the Linux inotify library to listen for changes to files, and I compare use of that against the Subversion program, I ...
2
votes
1answer
1k views

Try to find a word in the dictionary that has most letters given

Given some random letters , For example "a,e,o,g,z,k,l,j,w,n" and a dictionary.Try to find a word in the dictionary that has most letters given I was going through some old interview questions and ...
3
votes
1answer
255 views

Implementing Glicko Rating in Python

Recently, I've been trying to implement some working version of the Glicko Rating System for fun. However, I fail to understand how to programmatically isolate R in Step 2. As you can see R appears ...
1
vote
1answer
834 views

Tineye.com search algorithm?

I was wondering how does tineye carry a search. Does it store all the images and then extracts exif data? Which in turn must be stored in a database and queried against. So probably it is using some ...
0
votes
1answer
352 views

How can my code structure be improved? [closed]

I am looking for advice on the neatest way to structure my code. class Password { private string cipher; Password(string cipher) { this.cipher = cipher; } public string ...
10
votes
5answers
744 views

Interview puzzle on traveling on a line segment

Here's an interesting question I came upon: Let's just say on a number line of length M, where 0 < M <= 1,000,000,000, you given N (1 < N <= 100,000) integer pairs of points. In each ...
0
votes
1answer
213 views

Algorithm to detect a CLICK within Square range

It might be a simple question but I am looking for optimal solution. I will have numbers printed on a screen and I will be aware of coordinates. Numbers/Symbols will have 4 points(Square) to define ...
0
votes
3answers
461 views

A simple algorithm for finding duplicate floats [closed]

We have N numbers(real numbers(float)).They can be positive or negative or anything we do not know except the fact that there is exactly one number which has a duplicate and the rest all are distinct. ...
2
votes
1answer
126 views

Algorithm for deciding change in gesture

I am developing an application where I am taking dynamic gestures as input and then mapping them to keyboard controls. By dynamic gesture, I mean for example hand moving from left to right or hand ...
6
votes
3answers
894 views

Is there an appropriate coding style for implementing an algorithm during an interview?

I failed an interview question in C years ago about converting hex to decimal by not exploiting the ASCII table if (inputDigitByte > 9) hex = inputDigitByte - 'a'. The rise of Unicode has made ...
0
votes
1answer
120 views

overworld vs on-screen 2d tile organization

I am developing a 2d game where the world is made up of tiles. I have an overworld and a "current world": the current world represent the current tiles on screen at any given time, currently this ...
3
votes
1answer
255 views

Addition vs multiplication on algorithm performance

I am studying about optimizing alogrithms.(Prof. Skiena's Algorithm Guide book) One of the exercises asks us to optimize an algorithm: Suppose the following algorithm is used to evaluate the ...
0
votes
1answer
202 views

Algorithm Identification [ String & Dictionary ]

I recently heard of an interview question: Given a string and a dictionary. Break the string into meaningful words and I remember solving this before with dynamic programming fairly quickly (maybe ...
1
vote
2answers
361 views

Can I use the patented Octree algorithm in a public programming challenge?

Similar to this question, but for a very different situation. I've been working-up some example code to accompany a proposed programming challenge and asking questions about the difficult bits. In my ...
10
votes
2answers
5k views

What does it mean to say an algorithm is Sound and Complete?

I heard different interpretations of sound and complete. I understand that completeness means finding a solution if there is one. What does it mean to say an algorithm is sound. What does it mean ...
6
votes
3answers
720 views

A question regarding linked list vs vector insert/remove results comparison

I was reading this blog post: http://kjellkod.wordpress.com/2012/02/25/why-you-should-never-ever-ever-use-linked-list-in-your-code-again/ and I found there a code to run: http://ideone.com/62Emz ...
0
votes
2answers
229 views

Algorithm for picking reasonable min/max vals given a single value

I am making a simplistic in-browser IDE for some very domain-specific coding. Because I like Bret Victor's thoughts on Learnable Programming so much I thought I'd throw in some draggable numbers ala ...
2
votes
2answers
254 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 ...
2
votes
1answer
169 views

How much times command executed? Looking for mistake

I have following piece of code: int sum = 0; for (int i = 1; i <= N; i++) for (int j = 1; j <= N; j++) for (int k = 1; k <= N; k = k*2) for (int h = 1; h <= k; ...
0
votes
2answers
572 views

What is a good algorithm for priority allocation of work duties?

I am currently doing a project (in PHP) that has the following requirements: There is a list of people, sorted in a certain priority. Work should be allocated to them by this priority. e.g. If the ...
5
votes
2answers
1k views

Avoid DD anomalies

I have this problem called out by PMD (static code analyzer) more often that I would like, and would like to know how someone with more experience than me would write it. My code is functional but I ...
0
votes
2answers
193 views

Data structure for fast StartsWith filtering of a dictionary

I have a list of english words. I'm trying to come up with a data structure that allows me to do fast StartsWith filtering, like: var words = dictionary.StartsWith("foo"); I was thinking of ...
45
votes
7answers
4k views

How important is it for a programmer to know how to implement a QuickSort/MergeSort algorithm from memory?

I was reviewing my notes and stumbled across the implementation of different sorting algorithms. As I attempted to make sense of the implementation of QuickSort and MergeSort, it occurred to me that ...
4
votes
5answers
3k views

Can we technically un-blur images?

Since there is an algorithm to blur images, so that part of it cannot be recognised, can we reverse the algorithm and unblur part of than image? Is there a program that already does that, is that ...
7
votes
2answers
1k views

Algorithm for finding overlapping times

Part of our ERP system is a sub-system for running background jobs. We track a variety of meta-data about our jobs in a table including timestamps for submitted, started, and end times. I'm creating ...
3
votes
2answers
128 views

Clustering algorithm that doesn't require predefining the number of clusters required

I have a set of user queries from a search engine that I want to cluster. The only clustering algorithm I have come across so far is the K-means clustering algorithm, which requires defining the ...
2
votes
11answers
2k views

I don't understand why algorithms are so special

I'm a student of computer science trying to soak up as much information on the topic as I can during my free time. I keep returning to algorithms time and again in various formats (online course, ...
0
votes
2answers
453 views

Algorithms for data structures in distributed system

The hash table data structure can be easily spread across multiple machines with a simple algorithm to distribute the keys: machine_to_query = item_key % machine_count When you want to read and ...
2
votes
1answer
2k views

Container types in Golang

For a non-OOP language like google Go, is it idiomatic to go about implementing new container types using datatypes like arrays or lists so as to implement convenient functionality like contains ...
2
votes
1answer
101 views

Auto-completion or Suggest

How does Google or amazon implement the auto-suggestion at their search box. I am looking for the most used algorithm with technology stack. PS: I have searched over the net and found this and this ...
1
vote
3answers
424 views

Should I calculate hotness of a post on request or pre-calculate it?

Here is the Reddit's hot algorithm: cpdef double _hot(long ups, long downs, double date): """The hot formula. Should match the equivalent function in postgres.""" s = score(ups, downs) ...
1
vote
1answer
157 views

Implementing a sort of navigation system

So I am undertaking a project which does navigation sort of thing. So here is how the problem statement looks like. Say, given a map of a floor, with different rooms, now somehow, this information is ...
6
votes
2answers
389 views

Versioned Resources to Improve Cacheability

Here's an API concept which could be useful for performance optimisation. It's an example of key-based cache expiry applied to a broader internet-wide context instead of the internal Memcached-style ...
5
votes
2answers
917 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 ...
0
votes
2answers
220 views

How to create Button/Switch-Like Tile where you can step on it and change its value?

If the player steps on a Button-Tile when its true, it becomes false. If the player steps on a Button-Tile when it is false, it becomes true. The problem is, when the player stands on (intersects) ...
1
vote
4answers
968 views

algorithm to print the digits in the correct order

I've been trying to write an algorithm that will print separately the digits from an integer. I have to write it in Pseudocode. I know how to write an algorithm that reverse the digits. digi(n): ...
6
votes
4answers
644 views

algorithm for project euler problem no 18

Problem number 18 from Project Euler's site is as follows: By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 ...
1
vote
2answers
193 views

Sorting : Useful for more than just viewing data?

Context I'm currently working on a personal project involving functional reactive JavaScript, and I've come up with an odd question. Note that this question is not JavaScript specific, but that is ...
1
vote
1answer
274 views

Effective implementation of “array” of type Int X String -> String in .NET or in general

The question in general is: is there a more effective way of implementation of table with structure like Dictionary<int, Dictionary<string, string>>? The reason I am asking this is ...
3
votes
1answer
445 views

Loop invariant vs Assertions

I have an exam on Programming Concepts this Saturday and I am struggling to find some information to understand some concepts better. What is the difference between loop invariant and assertion? To ...
2
votes
1answer
218 views

Pattern for mobile app data synchronisation using HTTP over 3G networks

I have a mobile app built using jquerymobile, PhoneGap and some custom CSS and JavaScript. The data objects are received in JSON and used to display different forms to the user. For example { id: 1, ...
15
votes
3answers
1k views

Java and .NET: Why different sorting algorithms are used by default?

Just wondering why Java and .NET Framework uses different sorting algorithm by default. In Java Array.Sort() uses Merge Sort algorithm by default and as Wikipedia.com says: In Java, the ...
4
votes
2answers
1k views

Are there any algorithms for resource scheduling of courses-teachers-classes?

I'm developing an application to help school principals in dedicating teachers to classes and courses over the hours of a week (scheduling). The scenario is roughly something like this: User enters ...
7
votes
4answers
2k views

What are the differences between algorithms using data structures and algorithms using databases?

The General Question What are the differences between algorithms using data structures and algorithms using databases? Some Context This is a question that has been bugging me for some time, and I ...
3
votes
1answer
461 views

Root cause analysis in event correlation

I'm to write an event correlator module for the device we produce. When a fault occurs the resulting avalanche of logs about derivative conditions from various modules is readable only to a person ...
1
vote
0answers
92 views

josephus revisited - to get execution sequence

I was reading this Mathworld page on the Josephus problem: http://mathworld.wolfram.com/JosephusProblem.html from what I understood, once we get the place in execution sequence we can apply inverse ...
58
votes
11answers
6k views

Why is the use of abstractions (such as LINQ) so taboo?

I am an independent contractor and, as such, I interview 3-4 times a year for new gigs. I am in the midst of that cycle now and got turned down for an opportunity even though I felt like the ...