Let's say you have a set of ranges:
0 - 100: 'a'
0 - 75: 'b'
95 - 150: 'c'
120 - 130: 'd'
Obviously, these ranges overlap at certain points. How would you dissect these ranges to produce a list of non-overlapping ranges, while retaining information associated with their original range (in this case, the letter after the range)?
For ...
Duplicate of:
http://stackoverflow.com/questions/161288/what-would-be-the-best-book-to-read-in-order-to-really-grok-oop/161504
http://stackoverflow.com/questions/574001/what-books-do-you-suggest-for-understanding-object-oriented-programming-design-de/574619
http://stackoverflow.com/questions/455627/head-first-style-data-structures-alg...
Can anyone provide an algorithm to validate a Singaporean FIN?
I know with a Singaporean NRIC I can validate it via modulo 11 and then compare the result to a lookup table but cannot find a similar lookup table for the FIN.
I also do not know for sure if the modulo 11 is the correct method to validate.
I am aware the government sell...
Does anyone know a good method for mapping devices on a network?
I am looking for something that can establish the connection layout between devices to build a visual network diagram.
Any ideas?
...
What are "Splay trees”, “Red-black trees”, AVL Tree, B-Tree and T-tree?
looking for good implementations.
Thanks
...
I need to check if relation is transitive or not?
Would you please suggest some algorithm to check the transitivity of relations?
I am storing relation as a boolean matrix there is 1 if elements are related other wise 0 like in graphs.
Thanks.
...
A client I'm creating a site for wants a custom advertising "engine". The plan is to have a few ads on the site and fill the rest with Google Adsense until all the spots are full.
My problem is how to determine which ad to dipslay. (Assume for now that I only have 1 ad placement.) My thinking was I'd have a table with:
year
month
impr...
Hi all,
I have the following already sorted data:
AAA
AAA
TCG
TTT
TTT
TTT
I want to count the occurrence of each string yielding
AAA 2
TCG 1
TTT 3
I know I can do that with "uniq -c", but here I need to do extra processing on the overall C++ code I have.
I am stuck with this construct (modified according to 'pgras' suggestion)
#...
I have a list of documents and I want to display them grouped by the first letter of their name on a web-page, over three columns.
In short, something like this:
A | C | E
A | D | F
B | D | F
B | D | F
| D |
An important difference from say, the Windows Explorer view style is that I want letters to stay with each other. No breaking...
Yet again I have some questions regarding polygon algorithms.
I'll try to explain my problem:
I am using a subset of a third party library called Geometric Tools(GT) to perform boolean operations on my polygons. To accomplish this I have to convert my internal polygon format to the format GT uses.
Our internal polygon format consists...
I would like to be able to search a table as follows for smith as get everything that it within 1 variance.
Data:
O'Brien
Smithe
Dolan
Smuth
Wong
Smoth
Gunther
Smiht
I have looked into using Levenshtein distance does anyone know how to implement this with it?
...
What's the best (elegant, simple, efficient) way to generate all n! permutations of an array in perl?
For example, if I have an array @arr = (0, 1, 2), I want to output all permutations:
0 1 2
0 2 1
1 0 2
1 2 0
2 0 1
2 1 0
It should probably be a function that returns an iterator (lazy/delayed evaluation because n! can become so impo...
Following up on my previous question on the enduring properties of a book on algorithms, see here, now I would like to ask the community what language would you use to write the examples of such a reference book.
I will probably not use MMIX (!) to write the examples of the book, but at the same time, I think just pseudo-code would be ...
I have an array of dates in a one week range stored in an unusual way.
The Dates are stored in this numeric format: 12150
From left to right:
1st digit represents day: 1 = sunday, 2 = monday, 3 = tuesday, ...., 7 = saturday
next two digits represent hour in a 24 hour system: 00 = midnight, 23 = 11pm
next two digits represent minutes...
I'm trying to calculate the median of a set of values, but I don't want to store all the values as that could blow memory requirements. Is there a way of calculating or approximating the median without storing and sorting all the individual values?
Ideally I would like to write my code a bit like the following
var medianCalculator = ne...
Say, we have a program that gets user input or any other unpredictable events at arbitrary moments of time.
For each kind of event the program should perform some computation or access a resource, which is reasonably time-consuming to be considered. The program should output a result as fast as possible. If next events arrive, it might ...
Hi, I have to following problem to solve. I have to calculate the bidding price from a total price. For example, a client wants to pay 2000$ as a total price, but from this price, there are added costs:
-usage price which is 10% from the bidding price with a minimum of 10$ and a maximum of 50$
-seller price: 2% from bidding price
-ad...
hi, I am currently working on a data visualization project.My aim is to produce contour lines ,in other words iso-lines, from gridded data.Data can be temperature, weather data or any kind of other environmental parameters but only condition is it must be regularly spaced.
I searched in internet , however i could not find a good algorith...
Hi, in another post, MSN gave me a good guide on solving my algebra problem (http://stackoverflow.com/questions/639215/calculating-bid-price-from-total-cost). Now, even though I can calculate it by hand, I'm completely stuck on how to write this in pseudocode or code. Anyone could give me a quick hint? By the way, I want to calculate th...
Okay, I'm trying to write a program that could tell me if any points in a 30x100 rectangle rotated to 140 degrees are inside another 30x100 rectangle rotated to 200 degrees.
Honestly, I don't even know where to start. I thought about re-rotating them before doing normal calculations, but than they still wouldn't match up.
How can I do...