J
J
jd20502018-03-08 21:07:16
Java
jd2050, 2018-03-08 21:07:16

Is it worth reading "Algorithms in Java" by Sedgwick if you have already read "Data Structures and Algorithms in Java" by Laforet?

Hello!
I would like to understand what is the fundamental difference between the books, whether Sedgwick considers some topics that were not included in Laforet's book (if so, which ones), and whether it is worth spending time and money on his book after reading Laforet.
Thanks in advance for your replies.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ryabos, 2019-09-27
@Ryabos

I read Sedgwick after Laforet. Sedgwick writes much more clearly (both the code and the theory behind it). Laforet explains "on the fingers", but with spaces. To explain array sorting, he draws a football team, and Shell sorting is practically not described there, I could not understand it and read about it on the Internet. But Sedgwick describes in parallel a lot of nuances of both Java and the theory of algorithms. Interesting examples are given.
For example, in an additional section to one of the first chapters, where a list of tasks for better understanding, there is an elementary task: write a method that will return true if all characters of a String are cyclically shifted by several characters. And here is an explanation: the solution of such problems is very important in the study of gene sequences.
And there, unfortunately, there are typos. According to subjective feelings - in Laforet they are more often confusing. Sedgwick, I remember, had this typo: "LIFO (first in, last out)". And at Laforet, I could not understand the stack scheme for a long time (despite the fact that I knew how it works). In the end, I decided that this picture was just a typo, and the names of the two elements were confused with each other.

A
asd111, 2018-03-09
@asd111

The books treat pretty much the same thing. It is enough to read one.
There are a huge number of algorithms and data structures, and all types cannot be contained in one book.
There is a basic set of algorithms that every programmer should know, and this basic set is covered in every book.
The main thing to remember is that for many tasks there are ready-made algorithms so as not to fence brake bikes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question