🚤 "Never mistake motion for action." - Ernest Hemingway
this.push = function(x) { this.q.push(x); }
this.pop = function () { var ret = this.q[0]; this.q.slice(1); return ret; } } Usage:
var t = new Queue() t.push(4) t.push(10) t.peek() > 4 t.pop() > 4 t.peek() > 10
And here’s this week’s question:
Say you are given a list of a LOT of numbers (at least 100,000), and they’re sorted, and repeats are allowed. Write the psuedocode for an algorithm that determines if one of the numbers is present for more than half the list (make sure the runtime is the best you can get it, as in, looping through the whole list is probably not a good idea).
Â
Cool things from around the internet
3 Reasons Why You Should Quit Your Job
I fell 15,000 feet and lived
Keyboard featuring SA Photo Studio keycaps
A NASA satellite that monitors CO2 is revealing the inner workings of our planet​
Â
Joke
Why did Judy buy her friend a space heater?
It was a housewarming gift!
Â
Alright friends, that’s it from me. Have a good week, be safe, make good choices, and don’t stress out.
cassidoo