# Coursera Algorithms Course (4-6 weeks of study)

As promised, I am writing a continuation of an article on training in the Algorithms course.

Those who do not know the structure of the course, I ask in the first article, there I painted how the work goes. Here I will talk about the program of the final 3 weeks of study and the final exam.

Week 4
• Priority Queues. Priority queues, their basic operations are considered, the complexity of each of them is estimated. Considers the implementation of the queue through the binary heap (Binary Heap), as well as sorting based on this data structure (Heap Sort).
• Elementary Symbol Tables (symbol tables). This chapter is devoted to “symbol tables” (excuse me for such a direct translation), in other words, storing key-value pairs. The basic operations and their complexity in the implementation of symbol tables through a linked list and through a binary tree are considered. In my opinion, this chapter can also be considered as an excellent guide to binary trees and the operations performed on them. By and large, it’s not so important what we store in them, the chapter could very well be called Elementary Symbol Tables and BST.
• As a practical task, it will be proposed to implement a program for finding a solution to the game "tag."

Week 5
• Balanced Search Trees (balanced search trees, again I apologize for the direct translation, maybe not search trees, but binary trees). Probably one of the most useful chapters in the entire course. A red-black tree is considered, one of the fundamental data structures. It is considered in great detail and intelligibly, the analysis begins with 2-3 trees, and then, as their development, a red-black tree is considered. To his surprise, he learned that the author of the course, Robert Sedzhevik, had a direct hand in creating a red-black ebony in the form in which we know it.
• Geometric Applications of BSTs (application of binary trees for solving geometric problems). This section was a revelation for me, if everything that was considered earlier, I knew to one degree or another, then almost everything was new here, especially kd-trees - a very interesting data structure. In general, the possibility of using binary trees to find whether a set of points (or points) on the plane belongs to another set of points (segment or rectangle) is considered. Considers such varieties of binary trees as the KD tree and the Interval Search Tree.
• For a practical task, it is proposed to implement the search for the nearest point on the plane and the belonging of a point on the plane to a given rectangle using a kd-tree.

Week 6
• Hash Tables (hash tables). As the name suggests, the chapter focuses on hash tables. The first lecture is devoted to hash functions, as well as how to implement hash functions in java. Then the conversation goes about the hash tables themselves: their implementation is considered, an assessment of the complexity of the operations is performed. Much attention is paid to methods for resolving hash collisions in a hash table. One of the methods is known to all and is based on lists for each value of the hash function, the second method, for example, was also a discovery, I had never seen this before (one linked list is used to store all values).
• In the last week of the course there is no practical task, instead there is a final exam.

Final exam
I must say, the final exam is quite a difficult thing. 20 questions, many of which are open, i.e. no answer options (for example, write an array of numbers after the n-step of the specified sorting has been performed on it). Most of the questions were already in the previous exercises of the course, but there are several new types of tasks. For example, several statements or questions are given, as well as several answers are given, it is necessary to compare the answers with the corresponding statements. The task is complicated by the fact that each of the options can be used for 1 or more statements or not used at all. Or another example: 10 arrays of words are given and the initial array is indicated, it is necessary to determine the intermediate state of which sorting this or that array is (the task did it pretty well for me, and since I decided to do it last,