Skip to content

Instantly share code, notes, and snippets.

@eazybit
eazybit / RotationString.cpp
Last active July 25, 2017 20:37
[C++] - Rotation String
///////////////////////////////////////////////////////////////////////////
// RotationString.cpp //
// ver 1.0 //
// Type: source file //
// Language: C++ //
// Platform: Dell Alienware M14x, Win8 //
// Author: Yu Zhang, Syracuse University //
// yzhan39@syr.edu //
// Description: http://www.yu-zhang.net/blog/2014/07/07/interview-question-rotation-string-2///
///////////////////////////////////////////////////////////////////////////
@eazybit
eazybit / RunLengthCompression.cpp
Created July 7, 2014 22:42
[C++] - String Run Length Compression
///////////////////////////////////////////////////////////////////////////
// RunLengthCompression.cpp //
// ver 1.0 //
// Type: source file //
// Language: C++ //
// Platform: Dell Alienware M14x, Win8 //
// Author: Yu Zhang, Syracuse University //
// yzhan39@syr.edu //
// Description: //
///////////////////////////////////////////////////////////////////////////
@eazybit
eazybit / ReplaceSpace.cpp
Last active April 20, 2022 13:17
[C++] - Replace White Space with '%20' (any special character(s))
///////////////////////////////////////////////////////////////////////////
// ReplaceSpace.cpp //
// ver 1.0 //
// Type: source file //
// Language: C++ //
// Platform: Dell Alienware M14x, Win8 //
// Author: Yu Zhang, Syracuse University //
// yzhan39@syr.edu //
// Description: http://www.yu-zhang.net/blog/2014/07/07/cci150-interview-question-c-remove-or-replace-white-spaces-in-a-string///
///////////////////////////////////////////////////////////////////////////
@eazybit
eazybit / RemoveSpace.cpp
Last active August 29, 2015 14:03
[C++] - Remove White Spaces in a String
///////////////////////////////////////////////////////////////////////////
// RemoveSpace.cpp //
// ver 1.0 //
// Type: source file //
// Language: C++ //
// Platform: Dell Alienware M14x, Win8 //
// Author: Yu Zhang, Syracuse University //
// yzhan39@syr.edu //
// Description: http://www.yu-zhang.net/blog/2014/07/07/cci150-interview-question-c-remove-or-replace-white-spaces-in-a-string///
///////////////////////////////////////////////////////////////////////////
@eazybit
eazybit / PermutationString.cpp
Last active August 29, 2015 14:03
[C++] - Permutation String
///////////////////////////////////////////////////////////////////////////
// PermutationString.cpp //
// ver 1.0 //
// Type: source file //
// Language: C++ //
// Platform: Dell Alienware M14x, Win8 //
// Author: Yu Zhang, Syracuse University //
// yzhan39@syr.edu //
// Description: http://www.yu-zhang.net/blog/2014/07/07/cci150c-permutation-string///
///////////////////////////////////////////////////////////////////////////
@eazybit
eazybit / ReversString.cppe
Last active August 29, 2015 14:03
[C++] & [C] - Reverse String
///////////////////////////////////////////////////////////////////////////
// ReverseString.cpp //
// ver 1.0 //
// Type: source file //
// Language: C++ //
// Platform: Dell Alienware M14x, Win8 //
// Author: Yu Zhang, Syracuse University //
// yzhan39@syr.edu //
// Description: http://www.yu-zhang.net/blog/2014/07/07/cci150c-reverse-string///
///////////////////////////////////////////////////////////////////////////
@eazybit
eazybit / UniqueString.cpp
Last active August 29, 2015 14:03
[C++] - Unique String
///////////////////////////////////////////////////////////////////////////
// UniqueString.cpp //
// ver 1.0 //
// Type: source file //
// Language: C++ //
// Platform: Dell Alienware M14x, Win8 //
// Author: Yu Zhang, Syracuse University //
// yzhan39@syr.edu //
// Description: http://www.yu-zhang.net/blog/2014/07/06/cci150c-unique-string //
///////////////////////////////////////////////////////////////////////////
@eazybit
eazybit / TestString.cpp
Last active August 29, 2015 14:03
[C++] - String
///////////////////////////////////////////////////////////////////////////
// TestString.cpp //
// ver 1.0 //
// Type: source file //
// Language: C++ //
// Platform: Dell Alienware M14x, Win8 //
// Author: Yu Zhang, Syracuse University //
// yzhan39@syr.edu //
// Description: http://www.yu-zhang.net/blog/2014/07/06/c-string/ //
///////////////////////////////////////////////////////////////////////////
@eazybit
eazybit / DoubleList.cpp
Created March 16, 2014 02:48
Simple Doubly Linked List
#include "DoubleList.h"
#include "DoubleNode.h"
#include "Interfaces01.h"
IDoubleNode * DoubleList::getHead()
{
return _head;
}
@eazybit
eazybit / Interfaces01.h
Last active August 29, 2015 13:57
Simple Singly Linked List
#pragma once
#include <cstdlib>
struct ISingleNode {
ISingleNode() {}
virtual ~ISingleNode() {}
virtual void setValue(int value) = 0;
virtual int getValue() = 0;
virtual ISingleNode * getNext() = 0;