Skip to content

Commit

Permalink
stubbed out problems TODO.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeKarlsson committed Aug 9, 2018
1 parent d1bdbee commit fe92bcb
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# programming-problems

Solutions for various programming problems
25 changes: 25 additions & 0 deletions eventEmitter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Event Emitter
an event emitter is responsible for managing a set of listeners and publishing events to them when it is told such events happened
used in async event driven architecture
API:
addListener
removeListener
removeAllListeners
emit
once
listeners
http://learnjswith.me/build-an-event-emitter-in-javascript/
*/



const emitor = new Emitor();

const callback = function(x, y) {console.log(x + y)}
const sub = emitor.subscribe('event_1', callback);

sub.emit('event_1')
12 changes: 12 additions & 0 deletions facebook.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// implement a method to effieciently exlude items from the items array, as outlined in the exlude array.

const items = [
{type: 'computer', color: 'green', flavor: 'apple'},
{type: 'cellphone', color: 'gold', flavor: 'orange'},
{type: 'computer', color: 'silver', flavor: 'grape'},
]

const exclude = [
{k: 'type', v: 'cellphone'},
{k: 'color', v: 'silver'},
];
10 changes: 10 additions & 0 deletions iterator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
Implement an Iterator of Iterators which traverses through an arbitrary number of iterators. IE, an iterator which iterates over three list iterators in the following way:
L1 = a1, a2, a3
L2 = b1, b2, b3
L3 = c1, c2, c3
Then the iterator should process them in this order:
a1, b1, c1, a2, b2, c2, a3, b3, c3
*/

0 comments on commit fe92bcb

Please sign in to comment.