Skip to content

Instantly share code, notes, and snippets.

View dominicknguyen's full-sized avatar

dominicknguyen

View GitHub Profile
int[] sort(int[] a, int num) {
for(int z = a.length -1; z > 1; z--) {
if(a[z] == num) {
int temp = a[0];
a[0] = num;
a[z] = temp;
}
if(a[z] < a[z - 1]) {
int temp = a[z];
a[z] = a[z-1];
@dominicknguyen
dominicknguyen / stack.c
Last active November 15, 2018 06:15
Linked List Stack in C
#include <stdio.h>
/*
Linked list implementation of Stack in C
I'm learning C so it's not that good!
Feel free to leave tips!
*/