Quote:
Originally Posted by Barrin6
I love programming, however I think my lack of depth in math is leaving me frustrated at times. Will I ever get better at solving these kind of problems? Or there books that I could get to improve? For example below, we had this for our practice programming exam which I could not get.
One of the functions we had to write was to checks if two Rectangle objects intersect each other. Rectangle objects contains two Point structs with the each point on the opposing side diagonally.
Code:
Point {
int x, y;
};
If they do intersect, you have to create a new Rectangle with the new Points, otherwise return rectangle the first rectangle.
Rectangle intersection(const r& a, const r& b)
{
}
Are these the type of problems that you are either good at it or not?
the ability to solve, say, the tougher project euler problems is helpful in programming for sure. that said, there are many, many successful programmers without that kind of ability, because modern programming requires many other skillsets besides raw cleverness, among them familiarity and experience with a wide set of tools and technologies. (eg, mediocre raw problem solving ability + 5 years android experience probably makes you a more valuable android dev than a brilliant problem solver who's just completed Android Dev in 24 Hours).
that said, the problem above is truly basic and i'd expect anyone i hired to be able to solve it quickly. i'm not saying that to discourage you, but just to answer your question honestly. if you truly love programming, of course you can learn to get better at these types of things. time and desire can get you really far with most things, including programming.
there's also lots of books on improving these skills. this classic comes to mind:
http://www.amazon.com/How-Solve-It-M.../dp/069111966X
EDIT: I should add the problem as stated assumes both rectangles are parallel to the xaxis, which makes the problem easier than the general version of two arbitrarily rotated rects
Last edited by gaming_mouse; 11-25-2014 at 10:28 AM.