I have several data that looks like this:
Vector1_elements = T,C,A
Vector2_elements = C,G,A
Vector3_elements = C,G,T
..... up to ...
VectorK_elements = ...
#Note also that the member of each vector is always 3.
What I want to do is to create all combination of elements in Vector1 through out VectorK.
Hence in the end we hope to get t...
I am looking for a fast way to calculate the line segment of two given rectangles in 3D. For instance, each 3D rectangle is defined by its four vertices.
A solution in any reasonable programming language will do.
...
One of my friends came up with an interesting problem - Assume that we have a set of images in the system. Now, some one might submit a new image by slightly modifying any of the images already submitted, and in that case, the system should report that the submitted image is a forged image.
I can think about two solutions.
Solution 1 ...
I have need to do some cluster analysis on a set of 2 dimensional data (I may add extra dimensions along the way).
The analysis itself will form part of the data being fed into a visualisation, rather than the inputs into another process (e.g. Radial Basis Function Networks).
To this end, I'd like to find a set of clusters which prim...
Given an array of integers arr = [5,6,1].
When we construct a BST with this input in the same order, we will have "5" as root, "6" as the right child and "1" as left child.
Now if our input is changed to [5,1,6], still our BST structure will be identical.
So given an array of integers, how to find the number of different permutations ...
How can I modify the Smith-Waterman algorithm using a substitution matrix to align proteins in Perl?
[citations needed]
...
Hello!
I have a directed graph and my problem is to enumerate all the minimal (cycles that cannot be constructed as the union of other cycles) directed cycles of this graph. This is different from what the Tarjan algorithm outputs. For instance, for the directed graph at this wikipedia page, I would like to get c <-> d and d <-> h as tw...
Note: I'm not completely sure if this question really belongs to StackOverflow so feel free to vote for closing if you think not.
In Spain we have to undertake a final project when we end the computer science degree. The project must not be trivial and can relate to any computer field from Software Engineering to Computer Architecture, ...
I have an environment that serves many devices spread across 3 time zones by receiving and sending data during the wee hours of the night. The distribution of these devices was determined pseudo-randomly based on an identification number and a simple calculation using a modulo operation. The result of such a calculation creates an unne...
Suppose I have an array of coordinates, representing a route. I want to decompose this route so that it contains a point, say every 5 miles. How can I do that?
struct Location
{
double latitude;
double longitude;
};
vector<Location> route;
vector<Location> computeHigherGranularityRoute(const vector<Location>& oldRoute, double ...
Given an array of integers, how can you find two indices, i and j, such that the sum of the elements in the indices is maximized, in linear time?
...
I've been implementing an adaptation of Viola-Jones' face detection algorithm. The technique relies upon placing a subframe of 24x24 pixels within an image, and subsequently placing rectangular features inside it in every position with every size possible.
These features can consist of two, three or four rectangles. The following exampl...
For example: What algorithm is used to generate the image by the fresco filter in Adobe Photoshop?
Do you know some place where I can read about the algorithms implemented in these filters?
...
I need to sort a coordinate list for a rectangle counterclockwise, and make the north-east corner the first coordinate. These are geographic coordinates (i.e. Longitude, Latitude) in decimal form.1
For example, here are the 4 corners of a rectangle, starting with the north-west corner and moving clockwise:
[
{ "lat": 34.495239, "lng"...
I have an single-dimensional array of PHP objects. Each object has two attributes, one attribute is the object's unique ID and the other is the unique ID of another object in the array that is its parent. For example:
array(3) {
[0]=>
object(stdClass)#1 (2) {
["ID"]=>
int(1)
["parentID"]=>
int(0)
}
[1]=>
object...
Hello Coders !
I am developing a simple diagram tool with shapes on a plan using flex.
First i was using a simple 20*20 grid.
But the real cool stuff out their is auto axe magnet effect, that's how i call it at least to see why i mean by that i made a small video of balsamiq.
http://screenr.com/clB
http://www.balsamiq.com/
As you ca...
I'm looking for a good algorithms reference for functional programming. I have this book:
but all the examples are written in a procedural pseudocode. It's a fantastic book, though!
I also have this one:
Although all the examples are in Standard ML and Haskell, it's not really a complete reference since it doesn't cover some of th...
For finding the nearest neighbor, Space Partitioning is one of the algorithms. How does it work?
Suppose I have a 2D set of points (x and y coordinates), and I am given a point (a,b). How would this algorithm find out the nearest neighbor?
...
I started toying with this idea some years ago when I wrote my university papers. The idea is this - the perfect color quantization algorithm would take an arbitrary true-color picture and reduce the number of colors to the minimum possible, while maintaining that the new image is completely indistinguishable from the original with a nak...
Wikipedia says on A* complexity the following (link here):
More problematic than its time
complexity is A*’s memory usage. In
the worst case, it must also remember
an exponential number of nodes.
I fail to see this is correct because:
Say we explore node A, with successors B, C, and D. Then we add B, C, and D to the list of ...