Segment Tree (Update) for Range Min Query and Range Sum Query

Update query (Range min query) For update query, we are given an index which needs to be updated. Let val be the value needed to be changed of a given node x. We start from the root of the segment tree and update all nodes (containing minimum value from given index) which have given index in their range. If a node doesn’t have a given index in its range, we don’t make any changes to that node.

Trie – LeetCode Solution [Medium]

A Trie (pronounced as “try”) or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. Trie is an efficient information reTrieval data structure and hence the name Trie. It is a special data structure used to store strings. It consists of nodes and edges like a tree.

Activity Selection problem

Activity selection problem is the problem of selecting the largest set of mutually exclusive activities. Each activity has its own starting time si and finish time fi. No two activities can share the resource at any time point.

Job sequencing problem

There are n jobs to be processed on a machine. Each job i has a deadline and a profit. Profit is earned if the job is completed by its deadline. Job is completed if it is processed on a machine for unit time.