Yes, I know. We'll be looking for it, though. :)
You see the need for an efficient algorithm, right away!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to
ho will be working with me on this "Quest
16".
With a very efficient algorithm, and good hardware, we hope to get
through this before Scotty beams us up.
I 'm working on a program to generate these grids, but I'm also
looking for a faster way to do
Of course, the run time will be less with a faster system. If you want
I'll run it on my 2.66 GHz core2 duo,
and report the result.
A free file sharing site is swoopshare.com. If you'll zip the data
file you're using along with it, that will make the test much more
meaningful.
You'll need to copy
No help from here on the difficulty calculation for Sudoku solving.
My solver works like most of them, I'd guess. From the starting
position:
1) Add any "must have" numbers, if any, to the set of known square
values.
2) Delete any "can't be" numbers from the list of possible numbers for
each squ
Do you mean "Minimax"?
Minimax is an algorithm used in 2 player games. It gives programs the
much needed ability to "look ahead", to see what their best move might
be, using a depth-first search.
With just a very small change, minimax(), becomes the much more
efficient
Alpha-Beta().
There's a t
Every programming intro book has an example of a 2D array sort. Just
crack a book, or google it. Every sort algorithm will be different.
I presume "snake order" is column major key and row minor key sorting
of the 2D array?
Since the normal row major key column minor key sorting would have
somet
still to be packed
pieces, (which just can't be packed efficiently now), which will arise
if you consider just one box at a time.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" gro
Obviously there is no need for the one line of code that deals with
minimizing /maximizing player's moves, in this case.
A/B would still prune, but it would only prune out the piece
arrangements that left sub optimal piece arrangements, with more
wasted space.
You're right, Gene, this is indeed
In this algorithm, you need to search through a large tree or space,
consisting of all the possible combinations of piece orientations in
each box. That space can be searched beautifully using DFS, and alpha-
beta (NOT mini-max). Your "scoring" function, will just be scoring the
amount of free spa
I believe your goal can be reduced to "packing each box so it has the
smallest amount of wasted space".
(and with your shapes, it may be possible to reduce it further to
"each layer of the objects in the box, should have the smallest amount
of wasted space", since your objects are just 2D.
Now,
For each test case
Do
call function Read_it() /* read the next move */
call Count_it() /* count the # of squares walked
through */
while (move length is > 0)
print area moved through for that case
next
That would be my starting pseudo-code.
--~--~-~--~--
We don't use BFS in chess programming, so I can't comment on that
question. Memory requirements don't permit it.
Yes, we use recursive DFS, generally. Iterative DFS is more difficult,
and only programs designed to run on multiple processors at the same
time, (generally), use it.
At every level,
The simplest way to do this, is just to work through a sample of the
job by hand, first. Then, use the same logic you used to do it by
hand, for your program. Whether that means searching char by char, or
word by word, doesn't matter, imo. Use the one that you find easiest
to understand and progra
Linearly searching through the text (including the tags) WILL work
just fine, gomsi.
Post up a troublesome example, and I believe I can show you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" g
I use a variable in_side, to help this out. When the beginning of the
next word to be marked is found,
then the is written, and the in_side flag is set to 1 (true).
When the end of the current word being marked has been reached, then is written, and in_side is set to false.
When in_side is fals
For which ACM contest? They have regional events world-wide, and then
of course, the finals in Alberta, Canada next year.
For the latter, click here: http://icpc.baylor.edu/icpc/
For an explanation of one competition, go here:
http://online-judge.uva.es/contest/running.html
Enjoy!
--~--~-
I understood that the numbers in the sequences, would not be
consecutive. I used consecutive numbers only because
your example had used consecutive numbers.
Glad you found an answer you liked, Sticker. Looking forward to
reading your pdf file.
--~--~-~--~~~---~--~--
Of course, the index numbers lower than the book being checked out,
don't need to be changed, just the higher numbers.
I like using an array of structs with structure members which can
group all the relevant data together that I want for that book, or
student, etc.
So Books[] might have: title,
Darn it, I meant to post "Sticker shock", but my typo left out the
't'. .
Thanks for the clarification, Sticker.
I believe your algo can be tweaked a bit by simply adjusting your
substring's info when you need to "go back" to the start
of a substring. That is, when you drop the 2 from the substr
Well, now you've gone and given me Sicker shock! :)
Dilly of a problem, I must say!!
I can't offer you a possible solution, but I'm curious what algorithms
you've tried for this problem, and what was the resulting
performance?
I was thinking, something like:
Scan the numbers, putting all sequ
Counting sort, doesn't actually *sort* the elements, at all. That's
why it's so fast.
I don't know anything about using a constant amount of extra memory,
which is independent of the
size of the input, with counting sort.
When the input range exceeds the size of the counting array, won't you
be
I'm not sure this is oh-so elegant, but using an array:
int offset = 1003;
ranges[1768 - offset]. Set all values in array to 0.
Iterate through the list, and mark each ranges[list value - offset]
with a 1.
When you've gone through the full list, go back through the ranges[]
and anything with a z
You could do this a lot of ways, but I'd use a char array[] with a
size equal to the length of the subject string (including the end of
string null char '\0').
Then copy the subject string into the array[]. This would be the
"working" array[], where char's are deleted as they're found in the
patt
The matrices already correspond with each other, correct? So a[0]]0]
already should match with b[0][0], right? So if you start sorting,
you'll need to sort both matrices, and not just one column, since the
columns must be kept in their proper relationship with each other, and
since they're enormou
Shark, when you sway the diff should be based "on each line", do you
mean a horizontal "line" (row), or a vertical line of data (column)?
The red highlight I'm seeing on that link's web page, seems to
indicate that each cell in the array, must be checked, since there are
differences in each colum
Haven't played dominoes in years, daresay I don't know all the rules
anymore. If you know the rules to the game, and you know how to play,
then show what your algorithm is stuck on.
>From what I do recall, the object is to optimize your play for the
highest numbers. I don't get the "shortest comm
Wouldn't the ideal be to record the changes, as they are made?
(perhaps in a struct.) With large matrices, the very last thing you
want to do is a cell by cell comparison.
If it isn't possible to record what changes are being made, as they
are being changed, then a cell by cell scan would have to
you. Let us know how you come out with this, please. It's
an interesting problem, for sure.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, sen
gh, I'd look to make a keyed index as well,
and then a master "given number" set, to speed things up.
But that would be a job for me to code up. Something that was done all
the time and in critical high-volume typically, OK. Otherwise, I'd do
it the simpler way.
Adak
--~--~---
printf( "\n The repeating number is: %d", i );
}
This is way faster than sorting. I believe it is exactly O(n).
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
T
ry it and compare it with Quicksort's
performance, on the same data and system.
I'd bet money you'll have some enlightening surprises. The only
downside to this, is that Quicksort is easily "broken" - it may sort,
but not at near the speed it could.
If you tweak it, always
anges in it to work with the contest, however).
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from t
wade wrote:
> adak wrote:
> > What else do we need to know and agree on?
>
> Do players know the number of mines?
Normal would be 40 mines on the intermediate (16 x 16) board.
>
> What is the scoring system?
Your score would be the number of mined squares you succeeded
ormat that is commonly used for Minesweeper,
Jeff? (or anybody else). That's something I didn't know when I wrote up
my Sudoku program, so of course, it doesn't support it. :( (yet).
What else do we need to know and agree on?
Adak
--~--~-~--~~~---~-
be you can round up some of the programs from the net and compare
them, as well.
That would be interesting.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to
safe, and how safe a square,
really is.
Good luck
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsu
.
If the OS and / or your language offers a simple way to do a task, it's
almost always best to use it.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this
Until your array element is equal to the sum you're searching for,
every array element has to be looked at.
Binary search is not the way to go here.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"
Will it solve the problem of you spamming this group?
There are many groups entirely dedicated to philosphy, religion,
personal revelations, etc. Please don't bring it into this group,
without a topic that is related to algorithms.
d of dividing the
total sum by two, as a mid-point.
Perhaps that' one reason the guessing program I tested wasn't that
successful. Somehow, the program needs to learn something about the
specific set of numbers it has, in order to guess at a good goal for
each of the tw
that would
reduce the number of possible solutions, and work to solve the puzzle
by more "brute force" methods. When you have a puzzle with 99 squares,
and 50 of those squares may have unknown values (1-9), well, what is
50 ^ 9th power? Breaks my calculator, for sure!
Good luck, an
ing I've
missed. Answering the sorted array question in O(1) would be a treat.
:)
Nothing at all mentioned elsewhere in the book about partial checking
of arrays for sorted content?
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed
y few people have ever programmed
a fingerprint reader, see?
Adak.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsu
of values. Should the answer
be found at the extreme high end of the search space, it will use a lot
more computation, and a little more time. It's very important that the
implementation of the odometer, be
streamlined in it's operation. Any wasted code in the inner-most loops,
are going to have a
d the
image into an array of numbers, after reading the pixel's values.
One problem would be to "normalize" the contrast of each print - even
if it's on different material or with older obsolete ink, etc.
Quite a project, imo.
Adak
--~--~-~--~~~-
x27;s printed to the screen. Easy puzzles are done in
"zero" time, less than 6/100's of a second, for Windows.
If the "odometer" is used, it all depends how many rows you want it to
solve for, and how many possibles remain. The search always begins at
the lowest possible set
Thomas.Chang wrote:
> Following is a qsort() program, I checked it carefully severally times
> and tested with a lot of cases without finding any error. But when I
> submit the program using it to online judge, it always "wrong answer",
> if I substitute it with the standard qsort() of c library,
aints
of the bricks dimensions, into account. Likewise if the space was in a
corner. Hard work getting those bricks to bend 90 degrees!
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks&quo
friend loses his connection during the d/l, or his
throughput drops a lot.
Lots of co-ordination would be necessary.
Maximizing your total bandwidth, or getting a faster connection, makes
sense. But this doesn't sound like a real improvement, to me.
Adak
--~--~-~--~~--
Try "algorithm cross correlation".
You'll get a bunch.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@google
is just less than the match previously requested. */
return 0;/* no match here */
}
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to th
The program example continues to search the string even after a match
is no longer possible, but that's easy to fix.
Quite the elegant answer (no recursion however). If you get a string of
zero's equal in length to the length of the text you're searc
Jordan Greenberg posted:
"Using a spell checker is probably a good idea as well."
Having some meaninful content in your post, is an even better idea,
Jordan. This is NOT a spelling bee forum!
Adak
.
--~--~-~--~~~---~--~~
You received this message b
e same way. Still, keep
a healthy and thick "skin".
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
schedule it.
Using Alpha-beta algorithm with depth first search and a hash will
speed this up, quite a bit. If a server could direct the data and work
to several different core's or computers, that would provide another
big benefit, but also increase the complexity.
That's quite a problem!
presents a
batter's at-bat attempts.
Any other idea's?
Your thoughts, Anish?
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to al
7;s around. What have you googled for or tried in your
code, so far ? (in pseudo-code would perhaps be best)
Are there any further priorities in the queue's make-up which need to
be considered before their assignment into the scheduling table?
Adak
Adak
--~--~-~--~~~
Perl and Ruby, with built in pattern matching, it's a
very small amount of code. In 'C' and such, it's a bit more keyboarding
but the same result.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the G
With a bit of work, yes.
It's a geometry problem. The key is the point and angle (direction),
which are quite sufficient to locate any other points along the line.
What have YOU done to solve this? What have you read on this after
Googling? What have you coded up, so far?
with your suggestion, I believe.
So if he's already shown the pic associated with #2 in the database,
that pic will never be shown in the future "random" pics, to that
viewer, on that visit to the website.
Somewhat of a guess, given the scant info, but I believe th
Yes, but from the OP I understood he could NOT use any of the library
functions.
Your algo is the way to go, however. Giving him something to do is
good.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
I agree with you (although it can be difficult if you choose a tough
algo), but since he posted for help, wouldn't it be nice to give him a
bit of guidance?
I'm not saying do his whole assignment for him, but a starting point.
Adak
--~--~-~--~~~---~--
= i + 1
number(i) = 0
WEND
PRINT : PRINT
PRINT "User's Number Is: "; InputNum@
PRINT
PRINT "Which Backwards Is: ";
FOR i = 10 TO 1 STEP -1
IF number(i) > -1 THEN
i$ = STR$(number(i))
PRINT LTRIM$(RTRIM$(i$));
END IF
NEXT i
END
What language
sible value, like 0. If you leave it with just
who knows what in it, you may get quite a surprise! :)
Hope that helps, but also makes you "stretch" a bit to learn more about
it.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscri
on this, Cosmo? Typically, programs
made for things like this are worthless because the OP failed to
mention this, that, and the other "detail".
Adak
Any recommendations on how you could loop through all elements
recursively, only checking those which have not already been check
uses, and no need for the other
half of the array. That part is just knocked off the data pool.
I'll let you work with that, but let me know if you want C code that
does part or all of it.
Adak
--~--~-~--~~~---~--~~
You received this message because you are
Let the recursive call stack keep track of that, just take a look at
demo's of Quicksort, and you'll see what I'm talking about. You'll
probably want a left and right index or pointer, (or call them low and
high, whate
ant to be a good programmer, there's one thing you MUST do -
programming! You have to exercise those wings before you can use them
to fly to considerable heights. Ask any bird. :-)
Just now I have a better algo in mind to solve this problem. I may code
it up
ematically described by an exponential expression, then
it's exponential growth.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send ema
r two letters are repeats, so we ignore them. 4 + 3 = 7 CUSS's.
If the string had ABCD in it, it would have 4 + 3 + 2 + 1 = 10 CUSS's.
If you wanted to code it up, I'd use two nested for loops. You just
have to keep track of any duplicates so that duplicate substring won
moment, I would scap the "ray" idea,
and concentrate on the geometrical relationship of these two triangles.
My geometry is certainly NOT up for it, just now, but if you have your
geometry books still around or post this question on the math board (or
perhaps ask
and since they don't
know the answer is readily available by using a database, well then -
It just can't be done that way (using the database queries), and that's
final. ;-)
Adak
--~--~-~--~~~---~--~~
You received this message because you are s
of God are thinking, today.
Definitely, consider this closed.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To u
smack in the middle
of the graph display.
Does this help?
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To
Many projects have their own websites, and forums.
Sourceforge.net and others like it, are good places to start, though.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
sociology, not religion.
If many members of a group choose to bomb and shoot others, it will
reflect on the group as a whole. That's the nature of groups, isn't it?
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
allocated, even. Perhaps someone on Sourceforge.net has already done
this?
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks
estination.
There may be other considerations that favor NOT using the database, if
it's poorly designed for your type of query, so it takes too long to
produce the answer, or just overloaded by too many users.
That's a problem with that particular database implementation, but it
do
ans, and
neither of them was the same as MySQL.
If you want to see the query that will answer the OP's needs, you'll
have to find someone with that program, and probably pay him/her to
write it up. No one could write up the query from the info given by t
emotions behind these posts,
since I can't see your face, and have no previous knowledge to base my
opinions on.
Hope that helps,
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks"
FORE!
I would never call you a "mad" anything, except in rhetorical jest.
Sounds like a breakthrough here -
"So that, if you say: "with a database and indices you can solve the
problem
in a faster way", ok, I can agree ... "
Adak
--~--~-~--~~
series of indexed files.
Now, if the guy/gal who set up the database, was a goof-ball, and set
the database up with indicies which cataloged the number of light
fixtures in the properties, or the number of doors, or something dumb,
THEN it becomes a knapsack problem. (and the database programmer is
sh. Your willingness to
explore this truth is demonstrably shallow.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.c
database programmer's are SLY foxes, indeed. They know more
little tricks to speed things up than you can shake a stick at.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks&quo
the on-coming train to know that the train is a very powerful thing,
indeed.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@goog
re problems, are required!
:)
Is there a usenet group for MySQL? Should be something there or at
MySQL.com, of course.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
T
;s on modern PC's,
compared "fairly" (if that's even possible), side by side.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send em
hat's he's trying, at least.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from th
d). Sharks don't outswim
them, let alone humans. :-)
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To
;s all I need to hand out
the right number of phamlets to the proper addresses.
But nothing was actually sorted. It was just a distribution count (or
bucket sort, if you prefer). Won't work for all sorting problems, by
any means, but when it can be used - nothing can
Usually this type of problem is handled with a nested series of loops:
for var1 = 1 to 9
for var2 = 0 to 9
print var1, var2
next var2
next var1
You get the idea. Play with it.
Adak
--~--~-~--~~~---~--~~
You received this message because
e sorted data you need, is the distribution count or "bucket
sort". As I mentioned above, NOTHING can touch it, but it's not always
an option - since nothing is actually sorted.
Cleared this right up, didn't I?
Adak
--~--~-~--~~~---~--~~
You
ference on modern machines.
"
So true - and so insightful.
So why this?
"
That being said, I'd put my implementation of Introsort up against any
other generic sort any day of the week. The code is a C++ template
class, freely available at
http://www.michael-maniscalco.com/sortin
-
The only thing confusing here is the replacement of the largest item
from the array data, to the just-cleared array position, just made up
in that same array.
A fine refinement to have, but it can be confusing for others trying to
understand it.
Adak
--~--~---
Algorithms are ALREADY perfectly defined, without this mis-definition.
Check any dictionary or glossary of terms in a CS beginning course
book.
By simply re-defining some of his terms, he would be using the word in
it's correct definition.
I don't think that's
etc.
Also, I'd check the newsgroups and see if there isn't a graph usenet
group to assist you.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group
r to understand, but also glosses
over deeper truths that lies beneath that classification.
Adak
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send ema
, let's see if this Windows 2000 can sort it using it's
sort command, in a decent time."
What a shock! It was faster than my program. Wasn't even a close race!
Looking into it in the help files I found out why. Windows 2000 Pro has
dedicated micro-code for sorting, and guarantees
What I'd like to see you do to answer this, is set up a Monte Carlo
simulation program. Have it play 10,000 games with each possible answer
to the flip or keep, question. All from random draws.
Now compare their scores, and tell us who won. Did it match your
expectations, or not?
an absolute screamer, didn't I?
Try it, and you'll be amazed. But then, I'm easily amazed
when I see things like binary search, Quicksort, Alpha-beta, and
"bucket" sort. The concept is so simple - but the execution is so fast!
How about we toas
1 - 100 of 138 matches
Mail list logo