Archive | Programming RSS feed for this section

C++ Recursion – Binary Search

Binary Search using recursion Binary search is a method to search through a sorted container in order to find a particular value. Remember that “Guess the number” game? Let’s look at the following scenario by applying the Binary Search Algorithm in order for you to understand how Binary Search works. The Guessing Game Pick a [...]

Read more

C++ Recursion – Logarithm

Finding the logarithm of a number given a base Below is an example of how to determine the logarithm of a number of base 2 and then of any base. The logarithm of a number using a given base is power to which the base must be raised to result in the number. This tutorial [...]

Read more

C++ Recursion – Palindrome

Determining if a string is a Palindrome using recursion Below is an example of how to determine if a word is a palindrome using recursion. A Palindrome is a string that could be read the same way in either direction such as racecar, mom, and even a. This tutorial expects you to understands the following. [...]

Read more

C++ Recursion – Reverse elements of a vector

Reversing the elements of a vector using recursion Below is an example of how to reverse the elements of a vector using recursion. This tutorial expects you to understand the following. C++ Recursion Example of reversing the elements of a vector Below is an example of how one would reverse the elements of a vector [...]

Read more
euclid2

C++ Recursion – Greatest Common Divisor

Greatest Common Divisor using the Euclidean Algorithm Below is an example of how to create the recursive function of computing the greatest common divisor using the Euclidean Algorithm. * This tutorial assumes you understand the following. Introduction to Recursion in C++ Euclid’s Algorithm When studying computer science a famous algorithm taught to students is the [...]

Read more
network devices

Beej’s Guide to Network Programming

Learn Network Programming Learn network programming with Beej’s Guide to Network Programming. For those wanting to learn this guide is a great choice. The guide is concise and makes learning networking programming a lot easier. It is not by any means a complete guide, but it’ll help you enough so you could start on your [...]

Read more
fib04

C++ Recursion – Fibonacci

The Fibonacci Sequence Below is an example of how to create the recursive version of the Fibonacci sequence. But first of all, what is it? * This tutorial assumes you understand the following: Introduction to Recursion in C++ Fibonacci is a well known number sequence that models the growth of a rabbit population amongst other [...]

Read more