- #1
MinusTheBear
- 22
- 0
Hey everyone,
I'm in my second semester of programming which covers an introduction to C++ (the prior course was Python). We just covered classes and arrays, and are moving onto intro. to algorithms and pointers (we're currently mid-semester).
In the algorithms chapter, they covered 4 "basic" algorithms. Linear Search, Binary Search, Bubble Sort, and Selection Sort. My question is, how do you approach these? Not just from a professional standpoint, but academic, as well.
Is it useful to memorize the pseudocode to be able to implement it quicker? Or do you tend to just reference it as you need it? Next semester I start an introductory to data structures course, and then the following semester there's a data structures and algorithm course that's mandatory. So with that in mind, how should I treat these?
I'm sure some of them come more obvious as you program more, and some of them are fairly obvious how to code (like linear search). But when it comes to Binary Search and Selection sort, it doesn't come easy for me, and often I resort to looking up the pseudocode.
I can usually sit down with pen and paper and write pseudocode for it, but I'll normally be missing a variable or something relatively minor that becomes obvious when coding it. However, this is less efficient to me than just looking it up to begin with.
How do you handle algorithms yourself?
I'm in my second semester of programming which covers an introduction to C++ (the prior course was Python). We just covered classes and arrays, and are moving onto intro. to algorithms and pointers (we're currently mid-semester).
In the algorithms chapter, they covered 4 "basic" algorithms. Linear Search, Binary Search, Bubble Sort, and Selection Sort. My question is, how do you approach these? Not just from a professional standpoint, but academic, as well.
Is it useful to memorize the pseudocode to be able to implement it quicker? Or do you tend to just reference it as you need it? Next semester I start an introductory to data structures course, and then the following semester there's a data structures and algorithm course that's mandatory. So with that in mind, how should I treat these?
I'm sure some of them come more obvious as you program more, and some of them are fairly obvious how to code (like linear search). But when it comes to Binary Search and Selection sort, it doesn't come easy for me, and often I resort to looking up the pseudocode.
I can usually sit down with pen and paper and write pseudocode for it, but I'll normally be missing a variable or something relatively minor that becomes obvious when coding it. However, this is less efficient to me than just looking it up to begin with.
How do you handle algorithms yourself?