In your reply to what are advanced data structures (in comparison to basic ones), you say that they build in top of the basic ones. For example, a d-ary heap would be an improvement (depending on the use case) of a binary heap.
Another definition for an advanced data structure or algorithm could be one where multiple basic data structures are combined (e.g. Tim Sort, where the algorithm decides which sorting algorithm to use based in the nature of the input). Or a HashMap in Java, where a bucket is represented as a linked list or a red-black tree depending of the number of entries.
Does the book also cover examples of combined algorithms or data structures and how to analyse them?
I have two questions regarding the content of your book.
a) Does the book also cover the cryptographical details of the blockchain? Or is the reader expected to know these?
b) I see that there is a chapter on Unit testing the application. Is integration testing also covered?
You should consider making your code more readable, so it's easier to understand for people to review your code. Here are some points to consider:
- You have one long method with nested for/if. Consider using methods. You could, for example, create a method which takes a Strings and a number n as input and prints the string n times.
- Try to find an alternative for the first_time / second_time.
You could use a switch with an enum. This could be an option if you want to reuse the conditions and keep the switch short.
Here is a simplified example. Please note that I do not advocate this pattern, but it might be appropriate in some cases.