Skip to Main Content
Beginning Java Data Structures and Algorithms
book

Beginning Java Data Structures and Algorithms

by James Cutajar
July 2018
Beginner content levelBeginner
202 pages
5h 4m
English
Packt Publishing
Content preview from Beginning Java Data Structures and Algorithms

Understanding Complexity

To better understand algorithmic complexity, we can make use of an analogy. Imagine that we were to set different types of algorithms so that they compete against one another on a race track. However, there is a slight twist: The race course has no finish line.

Since the race is infinite, the aim of the race is to surpass the other, slower opponents over time and not to finish first. In this analogy, the race track distance is our algorithm input. How far from the start we get, after a certain amount of time, represents the amount of work done by our code.

Recall the quadratic method for measuring the closest pair of planes in the preceding section. In our fictitious race, the quadratic algorithm starts quite fast ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java 9 Data Structures and Algorithms

Java 9 Data Structures and Algorithms

Debasish Ray Chawdhuri
Object-Oriented Data Structures Using Java, 4th Edition

Object-Oriented Data Structures Using Java, 4th Edition

Nell Dale, Daniel T. Joyce, Chip Weems

Publisher Resources

ISBN: 9781789537178Supplemental Content