This tag is associated with 6 posts

C++: Menu

Given a list containing a number of strings of which one is to be selected and a prompt string, create a function that: Print a textual menu formatted as an index value followed by its corresponding string for each item in the list. Prompt the user to enter a number. Return the string corresponding to … Continue reading »

Free C++ Books

1. Fundamentals of Programming C++ (Richard L. Halterman) 2. C++ Annotations (Frank B. Brokken) 3. The C++ Hackers Guide (Steve Oualline) 4. Optimizing Software in C++ (Agner Fog) 5. Programming Abstractions in C++ (Eric S. Roberts) 6. Open Data Structures: An Introduction, in Java and C++ (Pat Morin) 7. Data Structures and Algorithm Analysis in C++, 3rd Edition (Clifford A. Shaffer) 8. Structured Programming … Continue reading »

C++: Filter

Select certain elements from an Array into a new Array in a generic way. To demonstrate, select all even numbers from an Array. As an option, give a second solution which filters destructively, by modifying the original Array rather than creating a new Array. #include <vector> #include <algorithm> #include <functional> #include <iterator> #include <iostream> int … Continue reading »

C++: Exponentiation Operator

Most all programming languages have a built-in implementation of exponentiation. Re-implement integer exponentiation for both intint and floatint as both a procedure, and an operator (if your language supports operator definition). If the language supports operator (or procedure) overloading, then an overloaded form should be provided for both intint and floatint variants. While C++ does … Continue reading »

C++ Graphs

Subscribe now to receive more great content like this! Email Address share on facebook share on twitter

C++: Dijkstra’s Algorithm

Dijkstra’s algorithm, conceived by Dutch computer scientist Edsger Dijkstra in 1956 and published in 1959, is a graph search algorithm that solves the single-source shortest path problem for a graph with nonnegative edge path costs, producing a shortest path tree. This algorithm is often used in routing and as a subroutine in other graph algorithms. … Continue reading »

UC Berkeley MFE Sideboard