Random commentary about Machine Learning, BigData, Spark, Deep Learning, C++, STL, Boost, Perl, Python, Algorithms, Problem Solving and Web Search
Saturday, August 31, 2013
Friday, August 30, 2013
What is the probability of dropping m balls in the same bin?
Suppose there are n bins
Thursday, August 29, 2013
Load balancing
We have a set of task i={1, ..., n} and each one has a cost b_i, how can we assigned to m servers so that the load is balanced?
Wednesday, August 28, 2013
Tuesday, August 27, 2013
Given an array of 1 million entries
Pick the smallest int.
Monday, August 26, 2013
Sunday, August 25, 2013
Triangle and Ants
On a triangle, there are 3 ants what is the probability that they collide when they move
Saturday, August 24, 2013
In a number of 64 bits
Swap odd and even bits.
Sunday, August 18, 2013
What is wrong with this code?
string FindAddr( listemps, string name ) { for( list ::iterator i = emps.begin(); i != emps.end(); i++ ) { if( *i == name ) { return i->addr; } } return ""; }
Friday, August 16, 2013
generate strings
Write a program that generates from the string "abcdefghijklmnopqrstuvwxyz{" the following:
a
bcb
cdedc
defgfed
efghihgfe
fghijkjihgf
ghijklmlkjihg
hijklmnonmlkjih
ijklmnopqponmlkji
jklmnopqrsrqponmlkj
klmnopqrstutsrqponmlk
lmnopqrstuvwvutsrqponml
mnopqrstuvwxyxwvutsrqponm
nopqrstuvwxyz{zyxwvutsrqpon
Thursday, August 15, 2013
Add two integers without using '+'
How can you add two integers without using + operator
Wednesday, August 7, 2013
Swap two integers
with no temp. How many ways do you know?
how many ways do you know to swap variables?
without using temp vars?
Sunday, August 4, 2013
Use a dictionary
Given a string like "thisisalongstringwithmisakenoten" and a dictionary of words, split the string so that the number of non matched words are minimized. Try to optimize the code
Saturday, August 3, 2013
Implement a smartpointer class
using templates in C++
Smartpointer s1(T * ptr)
Smartpointer s1(Smartpointer & s2)
and the assigment
s1=s2
Smartpointer s1(T * ptr)
Smartpointer s1(Smartpointer & s2)
and the assigment
s1=s2
Friday, August 2, 2013
Allocate a matrix of ints reducing the fragmentation
Subscribe to:
Posts (Atom)