Back to problems

Key Sum Management

Algorithm · Rubrik · Hard

Problem You are given a key tree whose initial keys all have value 0. The level of a key is determined by how many parent keys it has. For example, Key 1 is at level 0, Keys 2 and 3 are at level 1, and so forth. A sequence of rotation and rekey operations is applied to the tree. The operations input is represented as a two-dimensional string array so it can contain both Ro and Re records. Rotation Ro p v adds a new key with identifier v beneath parent key p. The newly…

Checking your access…