Author: ACMer
Write an algorithm to determine if a number is “happy”. A happy number is a number defined by the following process: Starting with any positive integer, replace the number …
A Binary Search Tree (BST) is a binary tree that satisfies the following requirements: The value of a parent node is bigger than all values of its left sub …
A Singly Linked List is a one-direction List that uses a pointer to connect between Nodes. To reverse a linked list, you need to re-connect the directions, for example: …
There are N gas stations along a circular route, where the amount of gas at station i is gas. You have a car with an unlimited gas tank and …
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which represents the number 123. Find …