Whenever I want to be exposed to the basics quickly, I usually start at course websites that have lecture notes and homeworks available for review. Maybe try something like <https://agora.cs.illinois.edu/display/cs231sp09/Schedule>? I must note though, that in general, I've found lectures slides...
I personally prefer a desktop due to being able to have a large screen size. I really find myself more productive with a 20 or 22 inch screen as opposed to a 14 or 15. You can, of course, have the best of both worlds and (eventually) buy a separate monitor for use at home.
Also, I've got to...
Another technique to improve efficiency (which is applicable to quite a few problems that are harder to optimize by simply converting to a loop of some sort) is using memoization.
The basic idea is to create a data structure that maps problem statements to solutions. In this case, you create...
I've taken a fair share of CS courses and I've come to the conclusion that learning to hack something together in a programming language is fairly easy, learning to do it well takes time, but taking a course that teaches the fundamentals of algorithms and data structures (as opposed to simply...
An important point to note -- your implementation is not O(n^2). As is tipped off by the experiments just performed - having recursion depths of greater than 100 for a 100 element array means you are trying to sort the same sized arrays multiple times.
Observe that you recursively sort the...
You're almost there. A few comments about two things that immediately stood out to me.
For computePositiveSum, look closely at what happens in the very last if statements. Basically, for computePositiveSum, consider the case that you are not at the end (startIndex != endIndex) and the first...
So you have the groundwork laid out for one possible solution - keep going along this path and you'll get there soon.
First, a comment about:
What is happening here is your x vector is being tested against 0 element-wise. Each element is either greater than 0 (denoted by 1, also known as...