Skip to content

Instantly share code, notes, and snippets.

View hckim16's full-sized avatar

Hyo Chang Kim hckim16

View GitHub Profile
@hckim16
hckim16 / Singly Linked List
Created October 2, 2017 16:10
Singly linked list with traverse and search functions, credit and help cited
//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 / runningmedian.cpp
Last active January 31, 2018 06:17
Find Running Median
#include <cmath>
#include <queue>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
@hckim16
hckim16 / sumDiagonal.cpp
Created February 1, 2018 12:09
Summing across diagonals and abs value of subtracting diagonal sums
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n;
@hckim16
hckim16 / hash.cpp
Created February 2, 2018 04:32
Code comes from an outstanding set of lessons from Paul Programming, https://www.youtube.com/watch?v=MfhjkfocRR0&t=266s
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
class h
{
private:
static const int tableSize = 5; //sets table size
@hckim16
hckim16 / leftRotate.cpp
Last active February 4, 2018 16:59
left rotation using standard libraries - vector and algorithm
#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 / factorial.cpp
Last active February 4, 2018 16:59
Simple recursive code for factorial solution
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int factorial(int n){
if(n == 0){
return 1;
@hckim16
hckim16 / modulo.cpp
Created February 13, 2018 05:39
Coding loop, modulo and following directions
//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 / varSizeArray.cpp
Created February 24, 2018 02:57
Hackerrank C++ Variable Sized Arrays challenge
#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 */