This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdlib> | |
#include <functional> | |
template <typename ValueT, typename ReasonT> | |
class Promise { | |
private: | |
enum State { | |
FULFILLED, REJECTED, PENDING | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const State = { | |
PENDING: Symbol.for('pending'), | |
FULFILLED: Symbol.for('fulfilled'), | |
REJECTED: Symbol.for('rejected') | |
}; | |
function changeState(state) { | |
if (this.state === state) { | |
throw new Error('Cannot transition to the same state'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Suite', function() { | |
describe('Inner Suite', function () { | |
it('should do something when some condition is met', function () { | |
}); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chai = require('chai'), | |
expect = chai.expect, | |
should = chai.should(); | |
var RoundQueue = require('<round-queue-implementation>'); // We'll fix this later | |
describe('Round-Queue', function(){ | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chai = require('chai'), | |
expect = chai.expect, | |
should = chai.should(); | |
var RoundQueue = require('<round-queue-implementation>'); // We'll fix this later | |
describe('Round-Queue', function(){ | |
describe('When adding elements', function(){ | |
it('Should add an element to the end of a non-full queue', function() { | |
// Queue with max size of 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chai = require('chai'), | |
expect = chai.expect, | |
should = chai.should(); | |
var RoundQueue = require('<round-queue-implementation>'); | |
describe('Round-Queue', function(){ | |
describe('When adding elements', function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var RoundLinkedQueue = function RoundLinkedQueue(size) { | |
} | |
module.exports = RoundLinkedQueue; | |
RoundLinkedQueue.prototype.push = function(data) { | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var RoundLinkedQueue = function RoundLinkedQueue(maxSize) { | |
this.maxSize = maxSize; | |
this.size = 0; | |
this._root = null; | |
this._last = null; | |
} | |
module.exports = RoundLinkedQueue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var RoundLinkedQueue = function RoundLinkedQueue(maxSize) { | |
this.maxSize = maxSize; | |
this.size = 0; | |
this._root = null; | |
this._last = null; | |
} | |
module.exports = RoundLinkedQueue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BinaryTree { | |
constructor(value, left=null, right=null) { | |
this.value = value | |
this.left = left | |
this.right = right | |
} | |
} |
OlderNewer