Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Computer Science Introduction to Algorithms Playing a Counting Game Quiz: Defining an Algorithm?

can someone please help me understand the quiz question?

I understand what an algorithm is and etc. but I can't seem to get my head around why we learn about them and data structures?

1 Answer

Joe Sharp
Joe Sharp
19,791 Points

Data structures and algorithms are some of the building blocks that make up programs and applications. Data structures are needed to be able to produce even basic working code. Selecting the proper data structure for a given task is something you will do a thousand times a day in practice.

Algorithms are useful to study for a multitude of reasons. The notable reasons that apply broadly to all programmers that I can think of off the top of my head are:

  • Ability to solve a familiar problem more quickly by using or adapting a known algorithm to solve your problem.
  • Ability for others to understand your intentions and for you to be able to collaborate effectively with your peers by speaking the same language.
  • Ability to recognize for any purpose a known algorithm in code you didn't write so you can understand what it does and why it is there.

These are not exhaustive answers but I hope they help in some way.