Skip to content

snmoore/doodles-cpp

Repository files navigation

Programming doodles in C++

atoi

Convert a string to an integer

binary_search

Find the position of a target value (a key) in a sorted vector using a binary search

binary_tree

Binary tree

circular_buffer

A circular buffer (or ring buffer) using an array

compound_words

Find the longest compound word in a list that is a concatenation of other words in the list

count_bits

Count the number of bits set in a 32-bit word

diamond

Print a diamond for a character between A and Z

easy_steps

Exercises from "C++ in Easy Steps", Mike McGrath

fibonacci

Generate the first 13 terms of the Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ...

insertion_sort

Sort a vector of values using insertion sort

linked_list

Single and doubly linked lists

matrix_multiply

Multiply two matrices with dimensions m x n and n x p

matrix_transpose

Transpose a matrix

overlap

Determine if two rectangles overlap

pairs

Trivial examples using pairs

quick_select

Find the median of a vector of values using quickselect

quick_sort

Sort a vector of values using quicksort

reverse

Reverse words and sentences

roman_numerals

Convert Roman numerals to decimal values

round_up

Round up an integer to the next highest power of 2

signal

Trivial signal handling

special_member_functions

Special member functions that the compiler will automatically generate if they are used but not declared explicitly by the programmer

stack

A stack implemented using a linked list

threads

Trivial threading example

tuples

Trivial examples using tuples

About

Programming doodles in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published