一个简单的例子来使用ES6的Promise object. var p = new Promise(function(resolved,rejected){ var random = Math.floor(Math.random() * Math.floor(2)); console.log(ran ... ...
Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of th ... ...
Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the posi ... ...
Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: The length of both num1 and num2 is < 5100 ... ...
Given a singly linked list, return a random node’s value from the linked list. Each node must have the same probability of being chosen. Follow ... ...