Intro to competitive programming - 3

Covered in this section:

Priority Queue

It is a special type of queue in which each element is associated with a priority and is served according to its priority. Its is based on binary heap (will be dealt with later).

priority_queue<Type, cont, cmp>

C++ STL for priority queue

Important time complexities for priority queue

Hash table

Hashing means associating a value with a key/index.

Hash tables are a type of data structure in which the key/index value of the data element is generated from a hash function. This enables very fast data access as the index value behaves as a key for the data value. This website shows a visualisation of hashing with seperate chaining.

In C++ hashing is used by unordered_map/unordered_set. Normal Map and set will be discussed later.

Next Lesson