Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


How to improve algorithm skills?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 DeadXorAlive   Members   -  Reputation: 535

Like
0Likes
Like

Posted 16 April 2006 - 02:02 PM

Usually I get by, but still, do you have some tips how to improve one's skill in making algorithms? It took me about an hour to find a way to transform (clamp?) a position in a range to the corresponding position in another range. (range of pixels - slider, to some value range). This is the best I could do if it makes sense: ValuePosition = ValueRangeLength * (1 / PixelRangeLength) * (PixelPosition - PixelRangeBegin) + ValueRangeBegin; Basically, I feel I'm too slow in this although I do enjoy it somewhat. I suppose a part is talent, but is it possible to improve my skill a bit and how? Thank you.

Sponsor:

#2 KaptainKomunist   Members   -  Reputation: 300

Like
0Likes
Like

Posted 16 April 2006 - 02:28 PM

all you need is a simple ratio.
(SliderLength/MaxValue) * value + offset

this will give you the value scaled to the slider.

Ah, this isn't what you wanted. I start with an equation, and solve for it. Try to have as few floating point operations as possible. Sometimes this is as simple as reorganising an equation. Other times you have to do some wicked assembly optomisation. Go look for the equation for carmack's reverse and inverse. They will blow your mind.

#3 DeadXorAlive   Members   -  Reputation: 535

Like
0Likes
Like

Posted 16 April 2006 - 02:51 PM

Quote:
Original post by KaptainKomunist
all you need is a simple ratio.
(SliderLength/MaxValue) * value + offset

this will give you the value scaled to the slider.

Ah, this isn't what you wanted. I start with an equation, and solve for it. Try to have as few floating point operations as possible. Sometimes this is as simple as reorganising an equation. Other times you have to do some wicked assembly optomisation. Go look for the equation for carmack's reverse and inverse. They will blow your mind.


You are still right: ( ValueLength / SliderLength ) * SliderOffset + ValueOffset [smile]

So basically I could focus on solving equations? Thanks.

I'm getting reasonably nice things done lately, but my code still sucks too much at a higher level to justify the effort of assembler optimizations.

#4 ph33r   Members   -  Reputation: 380

Like
0Likes
Like

Posted 16 April 2006 - 04:16 PM

Take some courses in mathematics and physics. That will increase your algorithmic and problem skills dramatically.

#5 Daerax   Members   -  Reputation: 1207

Like
0Likes
Like

Posted 16 April 2006 - 08:44 PM

I would go so far as to say that what is required to up your algorithin skill is practing and learning about algorithim design. Read on it and try to plan and then implement your own algorithims.

The problem solving methods of math and physics do not quite lend themselves well to programming because they are two different domains. There exists similarities but that is all they are, similarities. You must practice programming as well. With math there is generally a destination you wish to reach and theres is a vague idea of how to get there and you have a fair number of items to help get there. These items also allow you to construct more complex combinations to hasten your approach to your destination. In physics there is a puzzle that you are trying to put together and you make guesses at its original shape and use prior knowledge and tools to help do this.

In programming there is a general destination like math (indeed, you could say it takes place in the same landscape as your math travels) but there is not as much freedom and there are limits as to how you may operate everywhere. There is also a strong requirement of order in how you take your steps and plan. Heuristics and implications are not allowed, everything must be spelled out in a correct manner. Simply doing math will not prepare you for this. You must also program. In fact, you may find that programming helps to gather your thoughts and better grasp the internal details of some math while also inversely, math may help in better grasping a general external overview.

Desining a program is an engineering problem with strong aspects of planning,designing and foresight. Learning about programming, its structures and math simply increases the tools in your arsenal allowing you to approach desing problems from more angles and thus act more flexibly.

#6 Nuno1   Members   -  Reputation: 157

Like
0Likes
Like

Posted 16 April 2006 - 09:03 PM

algoritim skills come with experience.

I really recommend you to try programming challanges at ACM : http://acm.uva.es/

this site offer tons of programming challanges mostly related to optimization and algoritims. there are very hard challanges there and will advance you to the next level.

this may seems like a waste of time but it will affect you brain pretty fast :)

give it a try,
Nuno1




#7 DeadXorAlive   Members   -  Reputation: 535

Like
0Likes
Like

Posted 17 April 2006 - 01:07 AM

@Daerax: Well, you certainly put things into place, thanks.

@Nuno1: bookmarked, I'll try some of these.

Thanks for the replies, it has motivated me to hear this skill can be improved.

#8 BTownTKD   Members   -  Reputation: 205

Like
0Likes
Like

Posted 17 April 2006 - 02:16 AM

Some universities have classes devoted to algorithms. Case in point, my Data Structures and Algorithms class. To study for our final, my prof told us to just "practice solving problems." It's really vague, but if you like to program in your free time, I'm sure you can find problems to improve upon.

Things you learn in an algorithms class really are great -- you learn all about big-O notation and how to apply it to programs that you create.

HTH

#9 Spoonbender   Members   -  Reputation: 1254

Like
0Likes
Like

Posted 17 April 2006 - 02:21 AM

Quote:
Original post by BTownTKD
Some universities have classes devoted to algorithms.

I'd be scared if there are any that don't have those classes. At least, if they claim to teach comp. science...

#10 andy_boy   Members   -  Reputation: 100

Like
0Likes
Like

Posted 17 April 2006 - 07:46 AM

There is a book called Algorthmics. I believe the most recent edition was 2004. I recommend it since it focuses on algorithms as the core of computer science. Check it out.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS