Hey everyone,(adsbygoogle = window.adsbygoogle || []).push({});

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?

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# How do you handle algorithms (memorize vs. reference)?

Have something to add?

Draft saved
Draft deleted

Loading...

Similar Threads - handle algorithms memorize | Date |
---|---|

C/++/# Is there a flaw in my longest common subsequence algorithm? | Feb 24, 2018 |

Handling underflow errors in fortran 90 | Jul 10, 2017 |

Logic question (handling inequalities in a BASIC compiler) | Apr 14, 2016 |

Event Handling Code (basic) | Oct 31, 2015 |

GSL Multidim Minimizer - How to handle unphyiscal values | Jul 8, 2015 |

**Physics Forums - The Fusion of Science and Community**