• Create Account

## 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.

9 replies to this topic

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.

### #2KaptainKomunist  Members

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.

535
Like
0Likes
Like

Posted 16 April 2006 - 02:51 PM

Quote:
 Original post by KaptainKomunistall you need is a simple ratio.(SliderLength/MaxValue) * value + offsetthis 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.

### #4ph33r  Members

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.

### #5Daerax  Members

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.

### #6Nuno1  Members

161
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

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.

### #8BTownTKD  Members

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

### #9Spoonbender  Members

1258
Like
0Likes
Like

Posted 17 April 2006 - 02:21 AM

Quote:
 Original post by BTownTKDSome 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...

### #10andy_boy  Members

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.