Skip to content

Instantly share code, notes, and snippets.

Avatar

Hyo Chang Kim hckim16

View GitHub Profile
@hckim16
hckim16 / varSizeArray.cpp
Created Feb 24, 2018
Hackerrank C++ Variable Sized Arrays challenge
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 */
@hckim16
hckim16 / modulo.cpp
Created Feb 13, 2018
Coding loop, modulo and following directions
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;
@hckim16
hckim16 / factorial.cpp
Last active Feb 4, 2018
Simple recursive code for factorial solution
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;
@hckim16
hckim16 / leftRotate.cpp
Last active Feb 4, 2018
left rotation using standard libraries - vector and algorithm
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;
}
@hckim16
hckim16 / hash.cpp
Created Feb 2, 2018
Code comes from an outstanding set of lessons from Paul Programming, https://www.youtube.com/watch?v=MfhjkfocRR0&t=266s
View hash.cpp
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
class h
{
private:
static const int tableSize = 5; //sets table size
@hckim16
hckim16 / sumDiagonal.cpp
Created Feb 1, 2018
Summing across diagonals and abs value of subtracting diagonal sums
View sumDiagonal.cpp
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n;
@hckim16
hckim16 / runningmedian.cpp
Last active Jan 31, 2018
Find Running Median
View runningmedian.cpp
#include <cmath>
#include <queue>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
@hckim16
hckim16 / Singly Linked List
Created Oct 2, 2017
Singly linked list with traverse and search functions, credit and help cited
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.
*/
@hckim16
hckim16 / Finite State Machine
Last active Mar 19, 2018
Program models finite state automaton
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;
@hckim16
hckim16 / Airport Check-in simulation
Created Sep 30, 2017
Simulation check in at an airport counter with 2 queues and 2 first class counters for the first class queue and 3 coach class counters for the coach queue.
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