at my previous code, i used PriorityQueue to solve this issue. I am not that faimiliar with scala syntax, so it takes me some time to figure out how th customized the comparator.
f...
ex 1123456789101112131415161718192021/** * ex 1 * * Improve the Counter class in Section 5.1, “Simple Classes and Parameterless Methods,” * on page 55 so that it doesn’t tu...
firstly put the time profile function and print function
1def prn(x: TraversableOnce[_]) = println(x.mkString(x.getClass.getSimpleName + "(", ", ", ")"...
ex 11234567891011121314/** * EX 1 : * Write a code snippet that sets a to an array of n random integers between 0 (inclusive) and n (exclusive). * * @param n * @return */priv...
ex 11234567891011/** * ex 1 : * The signum of a number is 1 if the number is positive, –1 if it is negative, and 0 if it is zero. Write a * function that computes this value. * * @...
problemwhen run spark job to write data to es cluster on aws, I got error like this:
12345678910111213141516171819/01/09 16:18:41 WARN TaskSetManager: Lost task 0.0 in stage 0.0 (T...
after fork a project on github, you may also need to sync your repo with the original repo you forked from, how to do that?
add upstream1git remote add upstream git@github.intuit....
How to design an elevator systemthis is a famous interview questions. Design a elevator system would never be an easy task. How to ship people efficiently and quickly without over ...
manacher’s algorithmwhat’s it?manacher’s algorithm is good at calculate palindrome string, the time-complexity can reach o(n). it would re-use the pattern to calcuate, so it is ver...