O'Reilly logo

Everyday Data Structures by William Smith

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Searching

Array backed lists provides a O(1) operational cost for searches if the index of the object is known in advance. Otherwise, all searches in lists cost O(n) for unsorted lists and O(log n) for sorted lists where a binary search pattern is applied. Binary search algorithms will be discussed in much greater detail in Chapter 13, Searching: Finding What You Need.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required