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)

30
votes
7answers
6k views

When to use DAG (Directed Acyclic Graph) in programming?

I recently found a framework named ecto. In this framework, a basic component named "plasm", which is the ecto Directed Acyclic Graph.In ecto, plasm can be operated by ecto scheduler. I am ...
14
votes
4answers
1k views

How can I estimate the entropy of a password?

Having read various resources about password strength I'm trying to create an algorithm that will provide a rough estimation of how much entropy a password has. I'm trying to create an algorithm ...
1
vote
1answer
227 views

finds all possible permutations of a certain numbers of distinct digits

I am stuck on the following problem. I want to find an algorithm that finds all possible permutations of a certain numbers of distinct digits and then put them in a large matrix for instance. For ...
0
votes
1answer
259 views

Linear probing hashing collision resolution

So I have a quick question about the linear probing method of collision resolution in hash tables. So by definition a linear probing method would look like: while (hashTable[hash] != null) hash = ...
3
votes
6answers
338 views

Transforming A Physical Algorithm into a Computerized One

I have realized that its possible to create algorithms that operate physically to solve problems much more efficiently than in a computer itself. Consider the following: Finding the shortest path ...
4
votes
1answer
808 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 ...
8
votes
1answer
282 views

heuristic for searching through non-perfectly sorted data

Given sorted data, the search solution is obvious. Given unsorted data, sensible options are sort then search or just linear search. This question is about what to do if the data is somewhat sorted, ...
1
vote
1answer
109 views

Permuting a list of numbers by pushing and popping onto a stack

Suppose we have some long stack of numbers. There is another intermediate stack, and a destination stack to be returned in the end. The only two operations allowed is transferring the top of the old ...
14
votes
4answers
2k views

Is this a Proper “Rule” for Identifying the “Big O” Notation of an Algorithm?

I've been learning more about Big O Notation and how to calculate it based on how an algorithm is written. I came across an interesting set of "rules" for calculating an algorithms Big O notation and ...
25
votes
12answers
7k views

Do I need to understand algorithms and data structures to be called a programmer? [closed]

It has been six years since I have been coding. Coding into all kinds of things like ActionScript, JavaScript, Java, PHP, Ajax, XML HTML, ASP, etc. I have used arrays, maps, linked lists, sets, etc ...
8
votes
1answer
632 views

Possible Damerau-Levenshtein improvement?

I recently implemented the Damerau-Levenshtein distance algorithm from the pseudocode on Wikipedia. I couldn't find any explanation of exactly how it works and the pseudocode uses completely ...
3
votes
2answers
1k views

How to prove a Dynamic programming strategy will work for an algorithm?

How can I prove that a dynamic programming (dp) strategy for a problem will work or not? For greedy algorithms, we can prove by showing the sub problems exhibits matroid property. Is there any such ...
5
votes
5answers
710 views

Fastest way to find the closest point

I have a list in Python 2.7 of about 10000 point co-ordinates, like [(168, 245), (59, 52), (61, 250), ... (205, 69), (185, 75)] Is there a faster way to search for all the points in a bounding box, ...
-2
votes
2answers
258 views

About Artificial Intelligence [closed]

I am interested in starting a career in artificial intelligence. Can anyone suggest how I could prepare for this? What languages should I study that would be best for this career choice?
6
votes
3answers
1k views

What algorithm should I use to find the shortest path in this graph?

I have a graph with about a billion vertices, each of which is connected to about 100 other vertices at random. I want to find the length of the shortest path between two points. I don't care about ...
2
votes
1answer
114 views

Turning n-dim points into m-dim where m<n and where point-to-point distance deviation is minimized

I want to apply k-means clustering to a (sparse) adjacency graph. For this I need to assign the nodes to a position in an euclidean space. Trivially I can do this by having a space with as many ...
2
votes
1answer
158 views

Is there a standard name for this search approach?

In order to create a (Lucene) query, an "incomplete" domain object is used. All properties with a value are used for the query, the rest is ignored. In the absence of a better name, we call it ...
5
votes
5answers
672 views

Why interviewers want Optimal Algorithms

In an interview with a software company they asked me some algorithm design questions. Being strong in mathematics I was able to solve it mathematically, but each time when I propose my algorithm ...
-1
votes
1answer
149 views

Best way to clear balances between payers and payees

Say some 20 people go to a shop and everyone buys something. When it comes to paying, 5 of them pay the complete amount of 10,000$ split unequally between them. Since everyone bought different ...
3
votes
3answers
2k views

what is a efficient way to find repeating decimal

I am trying to find a efficient algorithm in Java to find the repeating decimal part of two integers a and b where a/b. eg. 5/7 = 0.714258 714258.... I currently only know of the long division ...
0
votes
3answers
143 views

Search on multiple values

I have a database having around 15 tables.Currently I am working on a report generation page, which is having 16 criteria.The values are distributed among multiple tables.User can select any number of ...
1
vote
1answer
163 views

Course Map Generator

My university lists the rotation of courses each semester/year. Therefore, it is possible to predict when every class will be taught. I am trying to create a JavaScript (language is irrelevant, ...
0
votes
1answer
546 views

Fast lookup hash map implementations

I'm in the process of implementing a programming language on top of LLVM. For my polymorphic system, I'm looking for suggestions for a ultra-fast dictionary. I am not concerned with insert time, as ...
6
votes
2answers
710 views

What is the Bible of Hashing?

Is there a Cormen-like reference on Hashes and Hashing? This particular structure has seen little attention in my CS education for some reason but I'd like to learn more as they seem to be everywhere. ...
1
vote
5answers
4k views

Is Bubble Sort the slowest sorting algorithm? [closed]

Is Bubble Sort the slowest sorting algorithm? If the answer is no, then what is the slowest one?
0
votes
0answers
115 views

Efficiently compute distance of location to POIs?

I want to write an android application that holds information where (climbing) rocks are located in a wider area. I want to display all rocks nearby my current location (say below 500m) and may be ...
1
vote
4answers
2k views

Algorithm for matching similar content text items

I am working on a website (C#, ASP.Net MVC 3) which reads some RSS feeds from multiple sources and put feed title and summary in a database table(Sql Server). What I want to do is: Put an algorithm ...
3
votes
2answers
487 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
1answer
723 views

A* Algorithm Completeness Proof

The A* Algorithm is the optimal (provided the heuristic function is underestimated), complete & admissible (provided some conditions). I know the proofs of admissibility & optimality. But how ...
9
votes
2answers
1k views

Which k-best shortest-path algorithms should I consider?

I'm solving a graph-search optimization problem. I need to find the k best acyclic shortest-paths through a directed weighted graph. I know there are a number of exact and approximate k-best ...
7
votes
3answers
433 views

Longest subsequence without string

Does there exist a dynamic programming algorithm to find the longest subsequence in a string X that does not contain Y as substring? Just that this problem seems so similar to other DP string ...
5
votes
5answers
258 views

What sort of questions drive the decision as to whether similar code is separate or common?

I have come across the following problem many times in various guises in my programming career. As a simple example, consider the following: Let's say there is a method (B) that could differ ...
2
votes
1answer
151 views

LOOP-computable functions

I was just reading a chapter about LOOP-computable functions and I have the following question: Is it possible to numerate every LOOP program with an algorithm? Formally: Is it possible to have a ...
0
votes
1answer
147 views

LOOP program only need inc and zero

I have 4 different commands in LOOP programming language: y=Zero() y=Val(x)=copy x and put it in register y y=Inc(x)=x+1 y=Dec(x)=x-1 Finally I also have loop n times { ... ...
3
votes
1answer
573 views

Convert letters to numbers

I have the following problem. Given A=1, B=2 , ... , Z =26 I need an algorithm that given a letter combination, like the column order in excel, returns me the number/ AA=27 AB=28 ABC? Thanks a ...
3
votes
3answers
229 views

Matching up articles with similar ones

I am creating a site where people can write on a niche topic. It is almost like a blog, however the area as I mentioned is a small niche with (hopefully) passionate users. I want a functionality ...
3
votes
1answer
221 views

Print fixed width list sorted by column

I have a list of varying length where items is strings of varying length. I want to print them by (a mirrored N)/order by column. Major points being: Columns shall have fixed width == widest data ...
-1
votes
1answer
118 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
273 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
254 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
642 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
263 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
862 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
353 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
750 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
217 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
466 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
902 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 ...