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. One 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 .
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:- 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.
- 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.
- Stacks and queues. Data structures such as stack, queue and priority queue, their effectiveness, and implementation in Java are considered.
- 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.
- 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.
- Non-trivial sortings. More advanced methods are considered: Shell sort, quick sort and radix sort, their algorithms, efficiency.
- 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.
- Red and black trees. We consider one of the most effective varieties of balanced trees, their rotation and color switching operations necessary for balancing.
- 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.
- 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.
- 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.
- Graphs. Weighted and unweighted graphs, algorithms for searching through them, and algorithms used to find the shortest traversal paths are presented.
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
- You can download applets here .
- Click on WorkshopApplets.ZIP and download the archive with applets.
- 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.
GO TO FULL VERSION