Here are some code examples written in C++
Even do they are written in C++, I would advice to compile them in Linux as I did. If you encounter any problems or errors, please let me know by providing an example of the code, input, output, and an explanation. Thanks
NOTIFICATION: These examples are provided for educational purposes. Using this code is under your own responsibility and risk. I do not take responsibilities of how they are used.
- Process input file – Count all alphabetics characters existent in the string
Code Example: StreamOperation.h, StreamOperation.cpp, processFile.cpp – Input/Output Files: Outfile.txt, input.txt
- Linked List
Code Example: List.h, List.cpp – Test Code Example: BigListTest.cpp, EmptyListTest.cpp, EvensTest.cpp, OddsTest.cpp, SingleEvenTest.cpp, UseList.cpp, UseList2.cpp, UseList3.cpp
- Linked List as template
Code Example: List.cc, mainDriver.cpp
- Simple Tree (VC++)
Code Example: mainTree.cpp, standard.h, tree.h, TreeFunctions.cpp – Input/Output Files: tree.txt
- Using vectors and iterators STL
Code Example: CardsHolder.cc, CardsHolder.h, mainDriver.cpp
- Generate prime numbers using Sieve of Eratosthenes algorithm
Code Example: primes.cpp
- Binary Search Tree (BST) as template. Using vectors, iterators, and time STL.
Code Example: BSTree.cc, main.cpp – Explanation: Writeup.txt
- Quicksort as template. Using Overload operation.
Example Code: doublesort.cpp, Item.h, Item.cpp, Sort.cc – Input/Output Files: sort.freq_.txt, short.alpha_.txt, output.txt, input.txt,
- Basketball Conference example
Example Code: Conference.cpp, Conference.h, Player.cpp, Player.h, Team.cpp, Team.h, Hoops.cpp – Input/Output File: teamFile.txt, Vermont.txt, UMBC.txt, StonyBrook.txt, NewHampshire.txt, Maine.txt, Hartford.txt, Boston.txt, Binghamton.txt, AmericaEast.txt, Albany.txt
- WarMachine card game example
Example Code: Card.cpp, Card.h, PlayingCard.cpp, PlayingCard.h, Player.cpp, Player.h, WarMachine.cpp, WarMachine.h, main.cpp – Input/Output Files: players.txt, output.txt
- Deque as template, priority queue, priority queue as template
Example Code: Deque.cc, PriorityQueue.cpp, PriorityQueue.h, PriorityQueue.cc
© 2010, Alejandro G. Carlstein Ramos Mejia. All rights reserved.