Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright (C) 2020 Raghavendra Nayak
*
* Permission to use, copy, modify, and/or distribute this software for any purpose
* with or without fee is hereby granted.
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
@raghunayak
raghunayak / strategy_design_pattern.cpp
Created July 16, 2015 10:59
Shows strategy design pattern.
/*
* (c) 2015 Raghavendra Nayak, All Rights Reserved.
* www.openguru.com/
*/
#include <iostream>
#include <string>
// This abstract class provides the SortingAlgorithm interface
class SortingAlgorithms
@raghunayak
raghunayak / adapter.cpp
Created July 2, 2015 09:31
Adapter Example
/*
* (c) 2015 Raghavendra Nayak, All Rights Reserved.
* www.openguru.com/
*/
#include <iostream>
#include <string>
// Window is the abstract base for all concrete Window implementations
class Window {