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)

3
votes
3answers
322 views

Does it always require a lot of programming practice before you really master an algorithm?

I have programmed for several years. And I found it is always difficult to master an algorithm(What 'master' mean here is to understand how the algorithm works and could implement independently in ...
16
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 ...
3
votes
2answers
726 views

Are suffix trees and suffix arrays identical? What are the differences?

I have read some information through internet...i found that somehow suffix tree is quite similar to suffix array but somehow they are no the same thing.. Given a string, a suffix tree construction ...
9
votes
4answers
2k views

N queens, X by Y board decision problem interview question

I was asked the following question in an interview today and I've been thinking about it ever since. I was not able to answer it and haven't been able to find a solution online. Given a chess board ...
5
votes
3answers
1k views

does quicksort provide less swapping step?

So far, most of the fastest and common sorting method is quicksort. Although it has its pro and cons. However, i'm thinking that although this sorting method is fast but does it provide shortest ...
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 ...
7
votes
1answer
4k views

What is the best “bucket-fill” algorithm?

I'm pretty new to image processing, and I am currently working on a paint-like application that will feature a bucket-fill. However, I have no idea what the best algorithm for a bucket-fill is. I ...
2
votes
4answers
407 views

Algorithm design for comparing split times in a race

I need to determine the ranking of values in an array without altering their position, so that I can print the position of each split time next to the actual value of the split time in a table like ...
8
votes
8answers
909 views

When developing algorithms, is skipping the pen&paper phase a bad habit? [closed]

I heard many people saying that when developing algorithms you should first use pen and paper, flowcharts and what not, so that you can focus on the algorithm itself, not worrying about the ...
2
votes
2answers
2k views

Best resources to really understand run-time complexity

I'm familiar with the basics of run-time analysis such as what makes certain types of code O(n) and O(n^2). But I'm having real trouble learning, understanding, and really remembering how to analyze ...
53
votes
11answers
3k views

Should a competent programmer be able to come up with his own shortest path algorithm?

I'm suffering a crisis of confidence in my ability as a computer programmer. Yesterday I tried to come up with my own shortest path algorithm for a graph and after some hours I simply threw in the ...
13
votes
3answers
1k views

Implementing technical paper algorithms in C++ or MATLAB

I am an Electrical Engineering undergrad. I've reading many technical papers about Signal and Image processing algorithms (reconstruction, segmentation, filtering, etc). Most of the algorithms shown ...
12
votes
4answers
964 views

What are the algorithms behind low pause GC?

Some languages, for exemple java, introduced a low pause GC. Those GC can do most of the work without pausing the whole world. This is obviously a quite hard problem because it require to analyze the ...
18
votes
6answers
2k views

How to turn truth table into smallest possible if / else block

How can I take a truth table and turn it into a compacted if block? For instance, let's say I have this truth table where A and B are conditions and x, y and z are possible actions: A B | x y z ...
8
votes
4answers
465 views

File shredder algorithm

As a part of learning system programming, I am looking to implement a file shredder. The simplest way (and probably seen as naive) would be to replace the data bytes with zeroes (I know OS splits the ...
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 ...
17
votes
4answers
6k views

In pseudo code what does := mean?

The section entitled Algorithmic Implementation has the following code: // Return RC low-pass filter output samples, given input samples, // time interval dt, and time constant RC function ...
4
votes
4answers
479 views

Implementing a machine learning algorithm to detect the region of an address

I have 10,000 addresses from a city, which all have a region field in the database. When a new address is entered, then I want my software to automatically detect the region of the address . I think ...
1
vote
1answer
223 views

Subset counting algorithm

I have a following problem i want to solve efficiently : Input: Set s of {Pass,Fail}^k vectors, m - minimum percent of vectors Output : Set of Sets of indexes: Where each set Contains indexes of ...
9
votes
3answers
17k views

Good way to learn how to solve questions on InterviewStreet [duplicate]

Possible Duplicate: How do I adapt to pre-interview challenge questions? InterviewStreet is a new company that essentially acts as a filter for companies to find programmers that can code. ...
11
votes
2answers
333 views

How to select a most probable option from the list based on user text Input

I am working over a OCR Application where I need to select a option based on user text input. Ex: Available Options: ["python", "ruby", "java", "clojure", "haskell"] Input: kava Output: java Input: ...
4
votes
1answer
444 views

Using Quadratic Bezier Curves to generate a cave that stays within certain bounds

I'm working on a project that generates a series of quadratic bezier curves and connects them together, maintaining slope from the end of one segment to the beginning of the next to make the ...
1
vote
7answers
1k views

Responding to interview questions involving unknown algorithms

Is there any acceptable/effective way to deal with interviewers who ask you to implement an algorithm that you aren't familiar with? I've been interviewing a lot lately and encountering this a lot. ...
20
votes
4answers
3k views

Is MapReduce anything more than just an application of divide and conquer?

Dividing a problem to smaller ones until the individual problems can be solved independently and then combining them to answer the original question is known as the divide and conquer algorithm design ...
5
votes
2answers
320 views

solve TOR edge node problem by using .onion proxy?

I would like to improve the TOR network, where the exit nodes are a vulnerability to concealing traffic. From my understanding, traffic to .onion sites are not decrypted by exit nodes, so therefore - ...
1
vote
2answers
947 views

How would an algorithm that splits/sorts numbers into three groups to make them equally large work?

I have to write an algorithm to split/sort numbers into three groups to make them equally large. To be more specific: I have three groups, let's call them A, B and C. Then I have a lot of numbers. ...
8
votes
3answers
325 views

Data “unsort” / homogeneity algorithm

In an attempt to not reinvent a wheel, I'm asking if anyone has ideas on a data homogeneity algorithm. A brief example: My data has several elements maybe like Number Color Fruit Letter There ...
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, ...
8
votes
2answers
7k views

elevator algorithm and implementation

I wanted to know how (real) elevators work. But, so far, I could not find much material about the algorithms they use, nor software (if any) for simulation. Could anybody give me references for that?
1
vote
3answers
683 views

Importance of algorithms in a telephonic interview

I had taken a telephonic interview and the interviewer has given some problem for which I was supposed to give him the algorithm. Since its was a telephonic interview and I had no paper or pen, so I ...
3
votes
1answer
238 views

Algorithm visualization app/plugin

I am looking for an application (or and IDE plugin) that I can use in order to test some algorithms I implement. Mainly metaheuristics used in TSP, VRP and other optimization problems. I have already ...
5
votes
6answers
423 views

Can I use publicly mentioned algorithms for writing programs?

I want to write a program that solves sudoku. So, I found some sudoku algorithms on Wikipedia. Can I use them or do I need to develop my own algorithm? Also, do I need to ask the specific license ...
2
votes
1answer
322 views

Did eastern PKUFFT algorithm beat FFTW3 (Fastest FFT on the west) 20 fold?

I wonder if PKUFFT is Chinese algorithm/library and is it really better than FFTW, MKL ? Thank you Edit: I will elaborate. My personal programmers interest is in fast parallel algorithms like FFTW3, ...
14
votes
4answers
12k views

Prerequisite math skill for Introduction to Algorithms (CLRS) book

I already have knowledge about basic algorithms. Now I plan to study more advance algorithms and I decide to go with Introduction to Algorithms. I'm not sure, do I need to refresh my math's skill ...
7
votes
1answer
781 views

How to document an algorithm properly with sample data?

I am wondering what should an algorithm documentation contain? Can't locate a proper guideline to follow. I have in mind to include summary of the algorithm description of the algorithm flowcharts ...
6
votes
2answers
3k views

Designing authentication for REST API

I'm working up an API for a REST service that I'm going to both be producing and consuming. I've spent the past few days trying to figure out how to handle authentication nicely, and think I've ...
7
votes
2answers
4k views

Is this a valid smartphone CPU vs. desktop CPU speed comparison (Android G1 vs. old Pentium 4 desktop)?

I am trying to estimate speed differences when creating code on my desktop PC that will be ported to Android phones. I don't need to be exact, but a good estimation will help stop me from creating ...
3
votes
10answers
622 views

Does it make sense to ask, “What is the difference between Design Pattern and Algorithm?”

From Wikipedia: In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. In software ...
2
votes
1answer
248 views

Most efficient way of finding entities in a grid?

I'm working on my first game; a tower defense. So far It's coming along nicely. The only issue I am having (so far) is I can't figure out a way to effciently discover if an entity has entered a towers ...
6
votes
4answers
205 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 ...
3
votes
2answers
633 views

Simplified knapsack in PHP

I have two instances where I'd like to display information in a "justified" alignment - but I don't care if the values are switched in order. One example being displaying the usernames of people ...
1
vote
2answers
155 views

Clarification of pseudo random number generator

I am asked to create a pseudo-random number generator using the following algorithm: The generator will generate every integer from 1 to N-1 exactly once The algorithm for N=2^n ...
10
votes
3answers
4k views

AVL Trees and the REAL world

in school we are taught how we can balance an AVL tree upon an insertion or deleting. How is this type of knowledge actually going to be useful in the real world? Can someone give an example on when ...
2
votes
1answer
143 views

Find next occurence in a Tree

Have a tree of variable depth, and width. What is the best algorithm to find the next occurence of the node in that tree. Next = Search to the right side of the tree ( as in breadth first search ) ...
8
votes
3answers
1k views

What is the best way to keep track of the median?

I read a question in one book: Numbers are randomly generated and stored into an (expanding) array, How would you keep track of the median? There are two data structures can solve the problem. One is ...
4
votes
3answers
2k views

Parsing scripts that use curly braces

To get an idea of what I'm doing, I am writing a python parser that will parse directx .x text files. The problem I have deals with how the files are formatted. Although I'm writing it in python, I'm ...
128
votes
14answers
7k views

Simple method for reliably detecting code in text?

GMail has this feature where it will warn you if you try to send an email that it thinks might have an attachment. Because GMail detected the string see the attached in the email, but no actual ...
11
votes
3answers
325 views

Why does the iterative version take longer?

I was looking over at http://programming.lispdream.com/blog/2011/06/recursion-vs-iteration/ and I saw that on his implementation of the recursive and iterative implementations of the factorial ...
11
votes
6answers
4k 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 ...
4
votes
4answers
239 views

Useful Pre-requisites for Operating Systems course?

How important is knowledge of data structures and algorithms for an Operating Systems and Systems Programming course where we will be required to design and implement a kernel of a real-time operating ...