Algorithms What are They?

Leave a comment

Programming is So SEXYShhhh, did you hear that? It’s officially the first day of fall. It arrived just a minute ago at 4:21 very AM here on the east coast and this October Libra baby is up (though NOT awake yet), to celebrate it with you.

Warning, I’m going to get techie for this one. Actually my birthday is right around the corner and I thought I would celebrate a little early by honoring the computer geek in me. I wonder what Kate Winslet & Josie Bissett are doing to prepare; yes both born on the same day as adorable me! Anyway, I was having a few drinks the other night with a former colleague and still very good friend who happened to be in town for a few days, when the subject of computer algorithms came up.

Ahhh, I can hear all my like minded and computer passionate followers starting to breathe heavily while their bodies begin to tingle and shiver all over, just like mine……True FOREPLAY for the mind.

She asked me what computer algorithms were and why they are necessary. Which surprised me because she was not a programmer; actually she was my administrative assistant and had very little interest in computers in general beyond what was required for her work. Seems she was starting to blog and kept hearing of the famous Google Algorithm, and thought the entire concept in general was proprietary to just them. After a very basic explanation from me, she started to get it, and was able to understand her new blog from the desired SEO perspective; that is….from Google’s Ranking Algorithm in determining your site or blogs worthiness to be returned in their search results and at what position when someone types in a particular keyword, or keyword phrase.

Food for Thought

But it got me thinking; that can be a pretty scary sounding word; yes this is what I do when I can’t sleep at 2:30 AM. I mean think about it, Algorithm, it sounds so complicated, so official, so complex maybe it’s just better left alone? Well let’s take a look, how does a world without your new high tech TV, no smart phone, no laptop, NO TEXT MESSAGING, no software, no computer games sound? No WII, Xbox, or Play Station….. Yes they are all around us guys, and life would be pretty boring without them. I for one would be totally lost if not for my true and first love of all…..SPORTS! And you know where I’m going with this; even sports have what can be considered basic algorithms, BOOYAH!!!

A computer algorithm is nothing more than a well defined sequence of instructions; procedures if you will to solve a particular problem. You can think of it sort of like a recipe, step one do this, step 2 do that………Sounds simple and we’ll try to keep it that way, but they can be quite long and complex. Using this term also indicates that certain “properties” will be true.

  • Clear-cut instruction that leaves NO room for interpretation. Go put gas in your car leaves too much room for interpretation.  Which gas station should I go to, which pump?  Which type of gas should I get, how much should I get, $10.00, $20.00, wait for it to overflow.
  • They will always return the same results and will terminate after a specific pre-defined time. Let’s face it, trying to terminate endless loops and algorithms that run an infinite number of times are no fun, and will most certainly put you on the hate list of any programmer who knows what they are doing.
  • They will produce and return a pre-defined output. A sorting algorithm is expected to and will return a sorted list, but how?  What data? Maybe it’s programmed to return and sort based on whole numbers ascending up to 2 billion, and then terminate at > +.00000128453.
  • They have defined inputs. Changing the font color of a particular word in your word document is an algorithm, but it requires a selected word in order for it to execute.

Algorithms vs. Computer Programs

So Andie, it’s really just another cool sounding name for program right? I mean after all, that’s exactly what computer programs do………..NO!!!!! An algorithm is a pre-defined step by step set of instructions for accomplishing a specific task or solving a very specific problem. A computer program is a specific sequence of instructions written in a specific programming language, which can include many different algorithms and is written in order to execute specific tasks with a computer.

HUH? Think of it as going to the gym to workout. That’s your computer program, it accomplishes the task of going to the gym, checking in, locking up your stuff, changing, stretching, banging out your cardio, and whatever arm or leg machines you are going to do that day, unlock your stuff, leave the gym, get in your car, and then off to wherever you are going next. However each of these particular segments is accomplished by a very specific algorithm.

The first one is solely for the purpose of getting into your car, making sure you have your gym stuff and driving to the gym, parking your car and getting out. It’s the job of the computer program to use logic to analyze the results of the ‘driving to the gym’ algorithm and respond in a conditional and logical way, to handle (react to) the results. This is known as conditional logic, a term you might have heard before; If XXX is True…. THEN…. ELSEIF XXX is FALSE…. ELSE…. END IF… and these routines get quite complex, 25+ ‘Nested IF Else Then’ statements can be a real pain in the ass to debug sometimes when something is not working correctly.

Getting back to our example; if our first algorithm is successful and all conditions have been met (i.e. you are in the correct place), move the logical flow and call the next segment, ‘check your badge on the way in, lockup your stuff, pick a machine, and program it for your specified cardio workout, get on and run until programmed to stop’. I mean after all there is NO point in moving onto the next segment ‘walk into the gym and check your badge,’ if you are sitting in the parking lot of Wendy’s Fast Food Restaurant instead of Planet Fitness where you should be; we missed the mark somewhere! FLOWCHARTING is a programmer’s best friend!

Save Your Sanity and FLOWCHART

Wow, so that was a long one but hopefully I’ve been some help in clarifying the difference for you; I’m rambling, running on NO sleep and need more black coffee because I’m doing a webinar in about 3 more hours. Hopefully you all received your email with link to join the live event, if not hit me up on Facebook, Twitter or Email and we’ll try to get that out to you before it starts. Let me know your thoughts, questions or fears regarding algorithms in the comments below.

Later Guys!

The following two tabs change content below.

Andie Parkes

Internet Marketer at Andie Parkes
Successful Internet Marketer for over 5 years. Programmer Analyst and Database Programmer & Automation Manager for 15 Years. I enjoy helping people learn and succeed online. Keep honesty foremost in everything you do and don’t be afraid to tell it like it is.

Latest posts by Andie Parkes (see all)

Leave a Reply