Author: ACMer
According to the definition of tree on Wikipedia: “a tree is an undirected graph in which any two vertices are connected by exactly one path. In other words, any …
Given an array, we want to shuffle it (to make it random), so that every possible random solution gets evenly-distributely possibility. One may quickly write a solution like this, …
Suppose you have written a few Javascript (NodeJS) unit tests using Mocha and Chai. You can run a specified set of unit tests by using mocha command. The first …
Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to intersect at node …
S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sorted in some custom order previously. We want to permute …