Geeks With Blogs
Mark Pearl February 2010 Entries
Stacks in C++
A stack is a LIFO (last in first out) data structure. A stack has at least two basic method calls – push & pop. Push, “pushes” an item on the top of the stack. Pop, removes the top most item off the stack. Implementation of Stacks as Arrays Because all elements on a stack are of the same type, one can use an array to implement a stack. The first element in a stack would be the first element in the array, the second on the stack would be the second on the array, etc. Linked Implementation of Stacks ......

Posted On Saturday, February 20, 2010 2:41 PM

Recursion in C++
The process of solving a problem by reducing it into smaller versions of itself is called recursion. This problem solving technique can be a very powerful way to solve certain types of problems that would be very verbose and lengthy using other techniques such as an iterative approach. When implementing a recursive solution one usually has at least two cases: Base Case General Case For a function/method to be called recursive, it usually has a call to itself within its code in the general case, with ......

Posted On Saturday, February 20, 2010 1:19 PM

Linked Lists in C++
General Basically, a linked list is a collection of nodes. Each node in the list has two components – a components to store information about that node (i.e. data) and a component to store the next “linked” node. The last node in a linked list indicates that it does not have a “linked” node – usually by a null reference. The address of the first node is stored in a separate location, called the head or first. The code snippet below shows a basic structure of a node declaration in c++. struct nodeType ......

Posted On Saturday, February 20, 2010 11:02 AM

Pointers in C++
This is a basic review of Pointers in c++ There are 3 main categories of data types in c++, Simple Structured Pointer A one liner to describe a pointer is a variable whose content is a memory address - thus its name “pointer”. In essence a pointer “points” to another location in memory. Declaring a Pointer (Specifying Variable Name & Size) In the most simple case, a pointer “points” to where another variable value is stored in memory. In programming terms, if you were to think about memory as ......

Posted On Monday, February 15, 2010 9:37 PM

Copyright © MarkPearl | Powered by: GeeksWithBlogs.net