Skip to content

Instantly share code, notes, and snippets.

🏊
Confusing

22Infinite WeiGrand

🏊
Confusing
Block or report user

Report or block WeiGrand

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View n-queens.js
/**
* Get all solutions of `n queens` problem
* https://zh.wikipedia.org/wiki/%E5%85%AB%E7%9A%87%E5%90%8E%E9%97%AE%E9%A2%98
* @param n
* @returns {*}
* @constructor
*/
const Nqueens = n => {
if (typeof n !== 'number') {
console.warn('Expect `n` to be a number got ' + typeof n + '.');
@WeiGrand
WeiGrand / react-fiber-stack.js
Last active Jun 25, 2019
Fiber (虚拟栈实现)
View react-fiber-stack.js
const a1 = {name: 'a1', child: null, sibling: null, return: null};
const b1 = {name: 'b1', child: null, sibling: null, return: null};
const b2 = {name: 'b2', child: null, sibling: null, return: null};
const b3 = {name: 'b3', child: null, sibling: null, return: null};
const c1 = {name: 'c1', child: null, sibling: null, return: null};
const c2 = {name: 'c2', child: null, sibling: null, return: null};
const d1 = {name: 'd1', child: null, sibling: null, return: null};
const d2 = {name: 'd2', child: null, sibling: null, return: null};
a1.child = b1;
You can’t perform that action at this time.