Consider the problem of merging two sorted linked lists whilst keeping the order. For instance if L1: 1->1->2->4 and L2: 2->3->5 Then the result should be 1->1->2->2->3->4->5. In Elements of Programming Interview, the author presents the following solution in Java, which consists of running through both lists and choosing the smallest value to add to a dummy head: The author
Tag: complexity-theory
Can i have too many features in a logistic regression?
I’m building a model to predict pedestrian casualties on the streets of New York, from a data set of 1.7 million records. I decided to build dummy features out of the ON STREET NAME column, to see what predictive power that might provide. With that, I have approximately 7500 features. I tried running that, and I immediately get an alert
Computational complexity of modulos and FizzBuzz
So I don’t want to go into whether this is the most perfect code for the FizzBuzz challenge. For those unfamiliar with FizzBuzz, there are four rules in printing out a range of 1-100: Print out all numbers; If the number is divisible by 3, print “Fizz” instead; If the number is divisible by 5, print “Buzz” instead; If the