Process vs Goals

What if instead of fretting over the goal, you might never reach, you think about creating a process that no only will help you to achieve the goal, but also in case you lose, make it worth your…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Wrapping Up

A Common-Sense Guide to Data Structures and Algorithms, Second Edition — Pragmatic Programmers (29 / 226)

👈 Binary Search vs. Linear Search | TOC | Exercises 👉

Often there is more than one way to achieve a particular computing goal, and the algorithm you choose can seriously affect the speed of your code.

It’s also important to realize that there usually isn’t a single data structure or algorithm that is perfect for every situation. For example, just because ordered arrays allow for binary search doesn’t mean you should always use ordered arrays. In situations where you don’t anticipate the need to search the data much, only adding data, standard arrays may be a better choice because their insertion is faster.

As we’ve seen, the way to analyze competing algorithms is to count the number of steps each one takes. In the next chapter, we’re going to look at a formalized way of expressing the time complexity of competing data structures and algorithms. Having this common language will give us clearer information that will allow us to make better decisions about which algorithms we choose.

👈 Binary Search vs. Linear Search | TOC | Exercises 👉

Add a comment

Related posts:

Spotting Bugs with clojure.test

And now we need to convince ourselves that this code does what it claims to do. Happily, Clojure comes equipped with a simple and capable library for writing traditional unit tests: clojure.test. In…

A Road to Joy

At one point in my life, I found myself living in a constellation of circumstances that were not what I had in mind, and were not all entirely pleasant. There was a lot to feel bad about, if I chose…

Whoever said all commercial bus drivers are rude needs to be checked.

It all Started With me Missing my Bustop and I was Dropped at OGOLONTO instead of IRAWO all cause I was too Deep in Thought. I had to Make a U-Turn and take Another bus to IRAWO so I can get on with…