JavaRush /Java Blog /Random EN /Book review: “Java Data Structures and Algorithms”, Rober...

Book review: “Java Data Structures and Algorithms”, Robert Laforet

Published in the Random EN group
The strength of every programmer is in his knowledge. Yes, the ability to google well is also not in last place, but nevertheless, there must be a certain amount of knowledge, on the basis of which the developer’s way of thinking is formed. The deeper this knowledge, the more interesting solutions a programmer can come up with. Book review: “Java Data Structures and Algorithms”, Robert Laforet - 1One of the parts of such a “base” is data structures and algorithms. How can you expand your knowledge in this direction? As an option, find a book, the knowledge from which will become a fireproof reserve and foundation for further study. For me, such a book was “Java Data Structures and Algorithms” by Robert Laforet .Book review: “Java Data Structures and Algorithms”, Robert Laforet - 2

For whom

The audience for this book can be a very wide range of people, because it will be useful both for those who have just mastered the syntax of the Java language , and for practicing programmers, for a deeper understanding of the features of data structures and algorithms.

About what

This book is devoted to the study and use of data structures and algorithms in programming. It will teach the reader how data structures determine the way data is organized in memory, as well as how algorithms perform various operations on these structures. Let's dig a little deeper and see what exactly this book is about:
  1. Arrays. Insert, search, and delete operations in arrays and ordered arrays are covered in detail. Demonstrates the operation of linear and binary search for ordered and unordered arrays. You will also learn what O-syntax is.
  2. Sorting. Three simple sorting methods are considered: “bubble sort”, “selection sort”, “insertion sort”. From the book you will learn which one is the slowest and which one is the simplest.
  3. Stacks and queues. Data structures such as stack, queue and priority queue, their effectiveness, and implementation in Java are considered.
  4. Linked lists. The book talks about doubly linked and double-linked lists, their efficiency, and how insertion, lookup, and deletion operations are performed. Iterators and what methods they require are also covered.
  5. Recursions. Recursions are considered in various situations, such as: calculating triangular numbers and factorials, constructing anagrams, performing recursive binary search, solving the Tower of Hanoi puzzle, implementing merge sort, solving the knapsack problem.
  6. Non-trivial sortings. More advanced methods are considered: Shell sort, quick sort and radix sort, their algorithms, efficiency.
  7. Binary trees. Balanced binary search trees are considered, how they work, their insertion and deletion operations, various types of traversal, search for minimum and maximum, search for a successor. The Huffman Code will also be covered.
  8. Red and black trees. We consider one of the most effective varieties of balanced trees, their rotation and color switching operations necessary for balancing.
  9. Trees 2-3-4. Trees of this type are described as an example of multipath trees; their operation and relationship with B-trees, which are used for external data storage, are discussed.
  10. Hash tables. Hashing and its various methods are covered, such as linear and quadratic probing, double hashing and the chaining method. You can also learn how hashing can be used to organize external file storage.
  11. Pyramids. This is a special type of tree used to efficiently implement priority queues. The book discusses the mechanisms of operation of insertion, deletion, and rearrangement. You will also learn what pyramidal permutation is and how it can be implemented in Java.
  12. Graphs. Weighted and unweighted graphs, algorithms for searching through them, and algorithms used to find the shortest traversal paths are presented.
For greater clarity, each chapter provides its own implementation of the data structure in question. For example, if this is a singly linked list, an example of a class that implements the described functionality will be given. The last chapter of the book, building on the knowledge gained from the previous chapters, begins to collect all the knowledge into a single picture. For example, you will be able to clearly form an idea of ​​which data structure to use in which situation: Book review: “Java Data Structures and Algorithms”, Robert Laforet - 3There are also small exercises at the end of each chapter. Some of them involve doing things with the Workshop app , while others give you small tasks directly in the code.

What are Workshop Apps

Workshop applications are used to demonstrate these structures and algorithms . Applications are designed as Java applets that can be run in a browser. Workshop applications create graphical diagrams that show how an algorithm or data structure works. For example, in one application designed to display columns sorted in ascending order, each time you click a button on the histogram, the next step will be performed. In this case, the values ​​of the variables involved in this algorithm will be displayed so that you can see how the code is executed (reminiscent of the description of a debugger , right?).

How to download and install Workshop

  1. You can download applets here . Book review: “Java Data Structures and Algorithms”, Robert Laforet - 4
  2. Click on WorkshopApplets.ZIP and download the archive with applets.
  3. To understand applets, you can read this topic and the comments to it.

Pros of the book

  • very easy to read, many examples are explained almost “on your fingers”;
  • opens your eyes to many “classical” things, without the use of complex mathematical formulas. Well, almost without them :)
  • Although the examples are in Java, the actions that occur in the code are explained in great detail by the text following and comments in the code. Therefore, it can be read by a user of any programming language, since the code examples are quite simple: they read almost like pseudocode.

Cons of the book

  • Despite the explanation "on the fingers", there are gaps in it. To explain array sorting, the author draws a picture of a football team, but Shell sorting is practically not described there: I could not understand it and read about it on the Internet;
  • There may be typos, usually in images or tables;
  • some code is quite outdated.

Analogues

I recommend analogues of this book or those following it (for those who want to continue studying):
  • “Algorithms in Java” by Robert Sedgwick;
  • “Algorithms: Construction and Analysis” by Thomas Cormen.

Bottom line

The book has few cons, so it is really worth reading. It clearly explains many basic, fundamental topics, such as various sorts, arrays, trees, collections, graphs, and so on. Since the book is not strongly tied to Java , the knowledge base gained from studying it will be useful in other programming languages. Must have, must read - if you are a developer.Book review: “Java Data Structures and Algorithms”, Robert Laforet - 6
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION