Tag: data structure
Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level). For example: 3 / \ 9 20 / …
Given a singly linked list, determine if it is a palindrome. A palindrome is a string/number that mirrors itself, for example, 21312 reverse is also 21312. We are given …
Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array is rotated to . Pop …
Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are: Almost every tree …
Given a binary tree, return its inorder traversal of its nodes’ values. For example: The binary tree, 1 \ 2 / 3 should return the inorder = . Recursion …