|
|
|
I’ve had a more or less continuous (and minor) presence on the web since the mid 90s, when I first created a site to host links to my magazine articles and book information. Until recently, I’d been using labor-intensive hand-crafted HTML for the entire site, but now I’ve switched to Wordpress, and this has been a big help.
I currently work for Cisco Systems, Inc., and I am a Contributing Editor for Dr. Dobb’s Journal, one of the last remaining old-school print programming magazines. I’m within just a few hours of completing my MS/CS degree at UT Dallas, whose CS Program is rapidly moving up in the ACM’s ratings.
If you have a specific question about an article you find here, please post it as a follow-up comment - that way everyone gets to benefit from our exchange. Personal email can be sent here (apologies for the anti-spam measures):

5 users commented in " About Mark Nelson "
Follow-up comment rss or Leave a TrackbackHi, Mark.
Nice to meet you.
I’m Carlos Eduardo Olivieri. A brazilian student programmer since 12 years old (currently, I have 24). I started with BASIC (QBASIC), have passed through PASCAL (Turbo Pascal), C/C++, Assembly and some other things :). I have always been interested in algorithms, sort, cripto, binaries trees, data compression, memory operations, improve instruction set use, etc.
I read your publication about permutations in C++ with function of STL next_perm(), very interesting and useful, after that I wrote one class method to get the next permutation in Delphi that is the tool most used for me in present days. This function works on lexographic order, I got the algo idea in another site, but now I have with big problem. I’m working with permutations with repetead elements in vector and there are lot of permutations that I don’t need. For example, I have this first permutation for 7 elements in lexographic order:
6667778 (6 = 3 times consecutively, 7 = 3 times consecutively)
For my work I consider valid perm only those with at most 2 elements repeated consecutively, like that:
6676778 (6 = 2 times consecutively at most, 7 = 2 times consecutively at most)
Short, I need a function that return to me only permutations that have at most N consecutive repetitions, according parameter received.
Do you know if there is some kind of algorithm to do that already done?
I intend to write to you more times.
Wait for your contact and sorry for any mistakes in text, I still don’t speak English very well.
Thank you so much,
Carlos
@Carlos:
I don’t have an algorithm for your “at most 2 repeats” requirement, I don’t think I’ve ever run across it. Brute force is my only suggestion :-)
Anyway, thank you very much Mark.
In fact, brute force I also already think :), but I’m trying to find another way, bacause the processing time has been a big problem to me. Hours, days running just one program over very small input dataset.
Regards.
Just a note to say Hi. I don’tknow if you remember me from the 80’s.
Did a bunch of beta stuff for Don Killen in the old days on the C desktop side of things. I was in medical electronics then.
Happy Holidays
Ron
You can delete this reply since it doesn’t go with the article. I didn’t find your email on the site.
My info is:
———–
Personal Email: ron.garlit@gmail.com
Business contact info:
Ronald Garlit
Lead Technical Architect | Distributed Computing .NET TEC
Technologies, Strategy and Operations | American Express Company
Ph: 856.848.7908 | Email: Ronald.A.Garlit@aexp.com
Carlos Eduardo Olivieri:
I wrote some code for your problem. While this may still be regarded as a brute force solution, it is somewhat more efficient than the most naive solutions as it does early pruning. Maybe you can get some ideas from it. A further idea could be to try to find a formula that can be used to determine if a valid string can be built from given frequencies.
Leave A Reply
You can insert source code in your comment without fear of too much mangling by tagging it to use the iG:Syntax Hiliter plugin. A typical usage of this plugin will look like this:[c]
Note that tags are enclosed in square brackets, not angle brackets. Tags currently supported by this plugin are: as (ActionScript), asp, c, cpp, csharp, css, delphi, html, java, js, mysql, perl, python, ruby, smarty, sql, vb, vbnet, xml, code (Generic). If you post your comment and you aren't happy with the way it looks, I will do everything I can to edit it to your satisfaction.int main()
{
printf( "Hello, world!\n" );
return 1;
}
[/c]