Viewing 29 to 35 of 53 items
Tag Archives: C++

Binary Search in C++

Binary Search is a method to search through a sorted container in order to find a particular value. Remember that one “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 number from 0  Full Article…

3

Bubble Sort C++

Bubble Sort Algorithm Bubble sort is the most primitive sorting algorithm. It simply iterates through a list and compares two elements and swaps them to put them in order. It repeats this process until no more swaps are made. Why Bubble Sort you may ask? You can think of the algorithm as “bubbling” the largest  Full Article…

5

Fibonacci in C++

Fibonacci is a well known number sequence that models the growth of a rabbit population amongst other things found in nature. The Fibonacci Numbers Sequence Below is the Fibonacci numbers computed up to the 11th term. 0 1 2 3 4 5 6 7 8 9 10 11 0 1 1 2 3 5 8  Full Article…

Introduction to Classes

C++ provides you with the int, double, string and other data types, have you ever wanted to make your own? As in, create a data type that stores maybe information relevant to a student, building, or even a simple person? You might have also encountered something like a vector. Maybe you want to create something  Full Article…

2

Programmer’s Notepad

An excellent alternative to Notepad, Programmer’s Notepad offers a versatile programming environment. Programmer’s Notepad Features Programmer’s Notepad allows you to create multiple file types and provides syntax highlighting for a great variety of languages such as C++, PHP, HTML, and so much more. You can also create and manage projects. You can open multiple files  Full Article…

0

Advanced Control Flow – Switch Statements

A switch statement allows you to control the flow of your program similar to if and else statements, but can be easier for the user to understand. The Switch Statement The structure of a switch statement is the following: switch(expression) { case : statements break; case : statements break; //More cases… default : statements }

5