Tag: algorithm
Dynamic Programming (DP) is one of the very important algorithm in Computer Science. Here is the simplest example of demonstrating the concept of DP if you want to tell …
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 / …
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 …
Convert a Roman numeral value (ranged from 1 to 3999) to Arabic integer. Letter by Letter Conversion from Roman to Arabic The first few Roman numbers are: I, II, …