Skip to content

Instantly share code, notes, and snippets.

// MultiplyMatrixes.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
int main()
{
int A[10][10], B[10][10], MULTIPLY[10][10], row_1, col_1, row_2, col_2, i, j, k;
// ReverseIntegers.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
int main()
{
int n, num, temp, reversed = 0;
// Maze.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
// LinearSearch.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
int linearSearch(int* arr, int size, int key)
{
for (int i = 0; i < size; ++i)
// RationalNumbers.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
class RationalNumber {
int numerator;
int denominator;
// EmployeeInheritance.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
class Employee {
static int ID;
string name;
// StackWithExceptions.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
class StackOverFlow:exception{};
class StackUnderFlow:exception{};
class Stack {
// IOStreams.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
// SmartPointers.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
class Rectangle
{
int length;
#include <iostream>
using namespace std;
// Time and Space - O(n)
int recursiveSum(int n) {
if (n == 0) {
return 0;
}
else {