Determining complexity for recursive functions (Big O notation)

The time complexity, in Big O notation, for each function: This function is being called recursively n times before reaching the base case so its O(n), often called linear. This function is called n-5 for each time, so we deduct five from n before calling the function, but n-5 is also O(n). (Actually called order of n/5 times. … Read more

Getting an error when I visit http://localhost

You can access “localhost” just fine. The “404: file not found” error indicates the server can’t find the requested file once you’ve connected to localhost. ADDENDUM: Maybe try to create a regular html file called test.html in one of your vhosts that is not working. Then try to visit that url. That should give you some clue … Read more

Haskell pattern matching – what is it?

In a nutshell, patterns are like defining piecewise functions in math. You can specify different function bodies for different arguments using patterns. When you call a function, the appropriate body is chosen by comparing the actual arguments with the various argument patterns. Read A Gentle Introduction to Haskell for more information. Compare: with the equivalent Haskell: Note … Read more