Implement an algorithm to merge an arbitrary number of sorted lists into one sorted list. The aim is to create the smallest working programme, in whatever language you like.
For example:
input: ((1, 4, 7), (2, 5, 8), (3, 6, 9))
output: (1, 2, 3, 4, 5, 6, 7, 8, 9)
input: ((1, 10), (), (2, 5, 6, 7))
output: (1, 2, 5, 6, 7, 10)
Note:...
Given a set of points s (a set of x,y coordinates) and a path that is made up of line segments joining a set of points l, describe an efficient algorithm that can be used to find a subset of points from s that are within the specified distance d of the path l.
A practical application of this may be to find a list of restaurants within 1...
Sorry in advance, I'm struggling a bit with how to explain this... :)
Essentially, I've got a typical windows coordinate system (the Top, Left is 0,0). If anybody's familiar with the haversine query, like in SQL, it can get all points in a radius based on latitude and longitude coordinates.
I need something much simpler, but my math s...
And hopefully with as little loss as possible, as I've heard the implementation put forward by a guy named Guido Vollbeding. Standard GDI+ doesn't seem to have this capability, and all I've found so far are either specs or fully-integrated tools. A lean, pluggable .NET component would be highly desirable. What are common pitfalls if it c...
Hi,
I've been searching Google (and stack overflow of course!) for a way to sort a list of integers by value, but also by an extra factor. I'm looking for some sort of algorithm to implement I suppose. So far, I have an array in Delphi 2007 that sorts the values from largest to smallest, but now I would like it to sort values that are...
Is there a widely-used algorithm that has time complexity worse than that of another known algorithm but it is a better choice in all practical situations (worse complexity but better otherwise)?
An acceptable answer might be in a form:
There are algorithms A and B that
have O(N**2) and O(N) time
complexity correspondingly, but...
From the man page for XFillPolygon
· If shape is Complex, the path may
self-intersect. Note that con‐
tiguous coincident points in the path are not treated as self-
intersection.
· If shape is Convex, for every
pair of points inside the polygon,
the line segment connecting them does not i...
Hi,
I have a scenario where i need to generate all possible keystrokes using numbers 2 to 9. The possible keystrokes should generate 2-git, 3-digit etc upto 32-digit numbers. can anybody tell me what is the best way to solve this problem.
Thanks,
Pdit
...
Can someone post any simple explanation of cache aware algorithms? There are lot of links available but the reading material in those sites is academic in nature and time consuming to read and comprehend.
...
Hi I am working on a online TIc-Tac-Toe game using the miniclip algorithm to calculate the best move.I found few examples but i really don't understand the miniclips logic.Some example would be great.
Thanks!
...
What's a good algorithm for determining the remaining time for something to complete? I know how many total lines there are, and how many have completed already, how should I estimate the time remaining?
...
I am doing a CSV Import tool for the project I'm working on.
The client needs to be able to enter the data in excel, export them as CSV and upload them to the database.
For example I have this CSV record:
1, John Doe, ACME Comapny (the typo is on purpose)
Of course, the companies are kept in a separate table and linked with...
Is there any algorithm in c# to singularize - pluralize a word (in english) or does exist a .net library to do this (may be also in different languages)?
...
Im looking for an algorithm to be used in a racing game Im making. The map/level/track is randomly generated so I need to find two locations, start and goal, that makes use of the most of the map.
The algorithm is to work inside a two dimensional space
From each point, one can only traverse to the next point in four directions; up, dow...
I have a large array of vertices, some of them are edges, some are redundant (inside the shape) and I want to remove those.
The simplest algorithm I could think of is checking one by one if they hit the shape formed by the others. But it should be a very slow algorithm.
I thought about picking one from the edge (the one farthest from o...
Hi,
How would I go about constructing the contour of 2d figure which is formed of only triangles and it can have holes and the external contour can be concave/convex and the holes can also be concave/convex.
From what I'm reading over here it seems that It's exactly the inverse of the triangulation problem.
Do you know any articles tre...
Okay this is not a question of "how to get all uniques" or "How to remove duplicates from my array in php". This is a question about the time complexity.
I figured that the array_unique is somewhat O(n^2 - n) and here's my implementation:
function array_unique2($array)
{
$to_return = array();
$current_index = 0;
for ( $i =...
Does anyone have experience with algorithms for evaluating hypergeometric functions? I would be interested in general references, but I'll describe my particular problem in case someone has dealt with it.
My specific problem is evaluating a function of the form 3F2(a, b, 1; c, d; 1) where a, b, c, and d are all positive reals and c+d >...
I have a simple program, at it's heart is a two dimensional array of floats, supposedly representing gas concentrations, I have been trying to come up with a simple algorithm that will model the gas expanding outwards, like a cloud, eventually ending up with the same concentration of the gas everywhere across the grid.
For example a giv...
I am trying to figure out what the day of the week of day zero (January 1st) of a given year.
So far I have looked at the Wikipedia page 'Calculating the day of the week' but I was wondering if there is an easiest algorithm if you're just trying to find day zero.
...