View varSizeArray.cpp
#include <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int main() { | |
/* Enter your code here. Read input from STDIN. Print output to STDOUT */ |
View modulo.cpp
//This simple code assumes numbers manually inputted via cout/cin | |
//input can be entered number of ways to include std stream of string data | |
//input may change but general coding logic straightforward and will not change | |
//for loop can apply to any "FizzBuzz" problem | |
#include <iostream> | |
//add appropriate libraries | |
using namespace std; |
View factorial.cpp
#include <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int factorial(int n){ | |
if(n == 0){ | |
return 1; |
View leftRotate.cpp
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
vector<int> left_rotate(vector<int>array, int r){ | |
rotate(array.begin(), array.begin()+r, array.end()); | |
return array; | |
} |
View hash.cpp
#include <iostream> | |
#include <cstdlib> | |
#include <string> | |
using namespace std; | |
class h | |
{ | |
private: | |
static const int tableSize = 5; //sets table size |
View sumDiagonal.cpp
#include <cmath> | |
#include <cstdio> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int main(){ | |
int n; |
View runningmedian.cpp
#include <cmath> | |
#include <queue> | |
#include <iomanip> | |
#include <cstring> | |
#include <cstdlib> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; |
View Singly Linked List
//courseID:CIS277-001 | |
//name: Hyo Chang Kim | |
//Prof. Eliscu | |
//Homework Assignment#4: Singly Linked List | |
//Due by 2/21/2017 | |
/* | |
I had a few challenges on this assignment. I wrote the code for creating a singly linked list that accepted the airport codes and miles as values. I wrote it as a do-while loop after setting the initial node to LGA and zero miles. The do-while then adds as many nodes as inputted to the last position. I wrote a second do-while loop with switch menu to give the user the option of displaying the entire list or to search for a specific code. | |
*/ |
View Finite State Machine
/* | |
This program that models a finite state automaton assigns conditions 0 to 4 that models state zero to state 4. | |
It only considers 0 and 1 as input. It only moves from state to state based on the input of 1101. Any other combinatin, | |
be it 1 and 0 or any other input will not move the state from zero to four. | |
I had considered using enum values to assign "words to integers" but decided to stay with integers for simplicity sake. | |
*/ | |
#include<iostream> | |
using namespace std; |
View Airport Check-in simulation
//Hyo Chang Kim | |
//Kim-CS610-2017-programming assignment 1 | |
//Professor Ali Mili | |
/* | |
Input: | |
1. Duration of Simulation | |
2. Average Coach Class Passenger Arrival Time | |
3. Average Coach Class Service Time | |
4. Average First Class Passenger Arrival Time | |
5. Average First Class Service Time |
NewerOlder