Back to problems

Solve four classic algorithm problems

Algorithm · Microsoft · Hard

This assessment contains four independent coding tasks. For each task, write the indicated function. Task 1 Given the root of a binary tree, return the node values level by level from top to bottom. On the first level, read values left to right; on the next level, read right to left; continue alternating after each level. Implement zigzagLevelOrder(root). Example 1: Explanation: The second level is traversed right to left, so [2,3] becomes [3,2]. Example 2: Constraints: $$0…

Checking your access…