Tag: C++ coding exercise
Simplify an absolute path for a file (Unix-style): For example, path = "/home/", => "/home" path = "/a/./b/../../c/", => "/c" Did you consider the case where path = “/../”? …
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, …
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that …
We have talked about the Pre-order in this post, and In-order Traversal for binary tree in this post. And this article talks about the third kind: Postorder traversal, which …
Return the preorder traversal of a binary tree’s nodes’ values. The pre-order displays the root/current node’s value first, then recursively calling into its left sub tree and right sub …