JavaRush /Java Blog /Random EN /Book Review: Java Data Structures and Algorithms by Rober...

Book Review: Java Data Structures and Algorithms by 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 some stock of knowledge, on the basis of which the way of thinking of the developer is formed. The deeper this knowledge, the more interesting solutions a programmer can come up with. Book Review: Java Data Structures and Algorithms by Robert Laforet - 1One of the parts of such a “base” is data structures and algorithms. How can you expand your knowledge in this area? 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 "Data Structures and Java Algorithms" by Robert Laforet .Book Review: Java Data Structures and Algorithms by Robert Laforet - 2

For whom

A very wide range of people can serve as an audience for this book, because it will be useful for those who have just comprehended 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 tell the reader how data structures define the way data is organized in memory, and how algorithms perform various operations on these structures. Let's dig a little deeper and see exactly what this book is about:
  1. Arrays. The operations of insertion, search and deletion in arrays and ordered arrays are considered in detail. The work of linear and binary search for ordered and unordered arrays is demonstrated. You will also learn what O-syntax is.
  2. Sorting. Three simple sorting methods are considered - “bubble sort”, “selection sort”, “insert sort”. From the book you will find out which of them is the slowest and which is the simplest.
  3. Stacks and queues. Such data structures as stack, queue and priority queue, their efficiency, implementation in Java are considered.
  4. Linked lists. The book talks about doubly-linked and double-sided lists, their effectiveness, and how insertion, search, and deletion operations are performed. Iterators and what methods are needed for them are also considered.
  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, and solving the knapsack problem.
  6. Non-trivial sorts. More advanced methods are considered: Shell sort, quick sort and bit sort, their algorithms, efficiency.
  7. binary trees. We consider balanced binary search trees, how they work, their insertion, deletion, various types of traversal, search for a minimum and maximum, search for a successor. The Huffman code will also be considered.
  8. Red-black trees. One of the most efficient varieties of balanced trees is considered, 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 work is considered, their relationship with B-trees, which are used for external data storage.
  10. Hash tables. Hashing and its various methods such as linear and quadratic probing, double hashing and chaining are considered. 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 the operation of insertion, deletion, permutation. You will also learn what a pyramidal permutation is and how it can be implemented in Java.
  12. Counts. Weighted and unweighted graphs, algorithms for searching through them, algorithms used to find the shortest detour paths are given.
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, starting from 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 by Robert Laforet - 3There are also small exercises at the end of each chapter. Some of them are related to performing operations with the Workshop application , while others give you small tasks directly in the code.

What are Workshop Applications

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 build graphical diagrams that show how an algorithm or data structure works. For example, in one of the applications designed to display ascending column sorting, each time the button is clicked on the bar chart, 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 (reminds you of the description of a debugger , doesn't it?).

How to download and install Workshop

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

Pros of the book

  • very easy to read, many examples are explained almost "on the fingers";
  • opens eyes to many "classic" things, without the use of complex mathematical formulas. Well, almost without them :)
  • although the examples are in Java, the actions 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 football team, and Shell sorting is practically not described there: I could not understand it and read about it on the Internet;
  • misprints are possible, usually in images or tables;
  • some of the code is very outdated.
Book Review: Java Data Structures and Algorithms by Robert Laforet - 5

Analogues

By analogy to this book, or following it (for those who want to continue studying), I advise:
  • "Algorithms in Java" by Robert Sedgwick;
  • "Algorithms: construction and analysis" by Thomas Kormen.

Outcome

There aren't many downsides to this book, so it's definitely worth a read. It explains many basic, fundamental topics in an accessible way, 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 by Robert Laforet - 6
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION