# Tagged Questions

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.

508 views

### What's the difference between the greedy and Hamiltonian methods?

Given T={CTAGC, GAGCG, AGCGG, CGGAG}, using a greedy algorithm, the superstring S will be CTAGCGGAGCG. From S, the combination of triplets will be given as s = {CTA, TAG, AGC, GCG, CGG, GGA, GAG, AGC,...
723 views

### What kinds of development jobs require knowledge of advanced concepts? [closed]

When I was in university, I participated in a programming contest; the problems turned out to be extremely difficult and boring, and they required previous knowledge about a particular set of problem, ...
994 views

### Where can I find an algorithm for creating 3D anaglyphs using a depth map image?

I'm looking for a generic algorithm to calculate a red/cyan anaglyph starting from the original image and its black/white depth map, as in this example? That algorithm is used, for example, in ...
938 views

### Finding all nearby points in a point cloud

What's the best way to store 3D point cloud data, optimising for time it takes to find all the points in a sphere of 3D space, and also for time it takes to insert new data points into the data set? ...
239 views

### Is there an efficient way to align degenerate strings?

I have a degenerate string S1=xadcdax, where x can be replaced by any of the four characters a, b, c, or d. This S1 string is match with another non-degerate string S2=dcbaa. I can first use brute ...
286 views

### What are the common techniques to handle user-generated HTML modified differently by different browsers?

I am developing a website updater. The front end uses HTML, CSS and JavaScript, and the backend uses Python. The way it works is that <p/>, <b/> and some other HTML elements can be ...
5k views

### Do real-world algorithms that greatly outperform in the class below exist? [closed]

Last night I was discussing with another programmer that even though something may be O(1), an operation which is O(n) may outperform it if there are is a large constant in the O(1) algorithm. He ...
3k views

### How to learn about graph algorithms and some real world applications? [closed]

I've read Franco Moretti's work, but I'm looking for something more technical and perhaps broad in scope, if possible. Specifically, I want to learn about techniques programmers are using to glean ...
7k views

### Is having trouble with data structures common for beginners? [closed]

I'm taking my second course on Java. We are getting into data structures. I have done an assignment on a linked list, and now a stack. I had a hard time with the linked list. The stack gave me a ...
2k views

### Why is the formal definition of Big O notation formulated as such?

Consider the formal definition: f(n) = O(g(n)) Why is it not: f(n) = O(f(n)) or f(n) = O(c*f(n)) since for the Big O analysis, f(n)=2n and g(n)=n are identical? I am ...
1k views

### Should I learn design patterns or algorithms to improve my logical thinking skills? [duplicate]

Possible Duplicate: How can I improve my problem-solving ability? When starting a programming task, I have trouble breaking it up into steps and figuring out how to go about solving it. I ...
5k views

### Big-O for nested loop

I am reading this post on Big-O It says that the following code is O(n^2): bool ContainsDuplicates(String[] strings) { for(int i = 0; i < strings.Length; i++) { for(int j = 0; j &...
4k views

### Theta notation on constant time. Why we use the 1?

In asymptotic notation when it is stated that if the problem size is small enough (e.g. n<c for some constant c) the solution takes constant time and is writen as Theta(1). Why we write 1 inside ...
1k views

### Algorithm Vs Design [duplicate]

Possible Duplicate: Is it essential to learn algorithms to be a real programmer? This question is, perhaps, related mostly to web developers who, like myself, code enterprise applications and ...
1k views

### Difference between complexity and performance guarantee

I'm a bit confused with the performance guarantee and complexity of selection sort. I checked through internet and the complexity of selection sort is O(n^2). This O(n^2) is in terms of time ...
299 views

### Complexity vs maintainability in modern hardware

Today with the modern hardware and memory coming cheap, how much sense does it make to spend effort to analyze algoriths or data structure complexity? Wouldn't it be better instead, to focus on clean, ...
420 views

### Is this the right strategy to convert an in-level order binary tree to a doubly linked list?

So I recently came across this question - Make a function that converts a in-level-order binary tree into a doubly linked list. Apparently, it's a common interview question. This is the strategy I ...
10k views

### Fast algorithm to search a sorted array of floats to find the pair of floats bracketing an input value

I have an array of floats, sorted from smallest to largest, and need to be able to pick out the nearest float greater than or less than a passed input value. This input value is not necessarily ...
125 views

### Is it possible to evaluate the efficiency of a testable algorithm against alternative solutions that aren't already built? [closed]

An e-commerce application I used to work on used a decision tree and a rules engine for each node in order to determine if a customer qualified for certain discounts. The problem was that every ...
427 views

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

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 ...
2k 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 Arrays....
1k 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 ...
3k 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 ...
2k 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 ...
3k 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 ...
2k views

### How to teach a script to detect sarcasm? [closed]

I'm currently building a fun script, that basically matches given phrases and gives a predefined response based on the match-points. You can ask it to retrieve some information based on live feeds, ...
9k 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 ...
461 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 so....
1k 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 ...
3k views

### Best resources to really understand run-time complexity [closed]

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 ...
4k 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 ...
2k 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 ...
1k 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 ...
4k 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 -----...
623 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 ...
4k views

### Is there an encyclopedia of algorithms? [closed]

Is there an encyclopedia of algorithms similar in style to the Handbook of Mathematics? It seems useful to have large numbers of them available in one place. I know the Art of Computer Programming is ...
11k 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 ...
858 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 ...
237 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 ...
19k views

### Good way to learn how to solve questions on InterviewStreet [closed]

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. My ...
367 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: ...
534 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 ...
5k 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 ...
328 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 - ...
2k 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. ...
373 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 ...
3k 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, ...
14k views

### elevator algorithm and implementation [closed]

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?