Category: data structure
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 its inorder traversal of its nodes’ values. For example: The binary tree, 1 \ 2 / 3 should return the inorder = . Recursion …
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. …
Given a binary tree root, return whether it’s a binary search tree. A binary tree node is a binary search tree if : All nodes on its left subtree …