Skip to content

Instantly share code, notes, and snippets.

View courtneyfaulkner's full-sized avatar

Courtney Faulkner courtneyfaulkner

View GitHub Profile
@courtneyfaulkner
courtneyfaulkner / SortedArrays.groovy
Created September 6, 2017 04:29
[SortedArrays] #practice
class SortedArrays {
/*
For Example
A = {10, 15, 25}
B = {1, 5, 20, 30}
The resulting arrays are:
10 20
10 20 25 30
10 30
@courtneyfaulkner
courtneyfaulkner / ZigZag.groovy
Created September 6, 2017 04:30
[ZigZag] #practice
class ZigZag {
/*
Example:
Input: arr[] = {4, 3, 7, 8, 6, 2, 1}
Output: arr[] = {3, 7, 4, 8, 2, 6, 1}
Input: arr[] = {1, 4, 3, 2}
Output: arr[] = {1, 4, 2, 3}
*/
static void main(String[] args) {
@courtneyfaulkner
courtneyfaulkner / BinaryTreeBottomView.groovy
Created September 6, 2017 04:30
[BinaryTreeBottomView] #practice
class BinaryTreeBottomView {
public static void main(String[] args) {
Node root = new Node(20)
root.left = new Node(8)
root.right = new Node(22)
root.left.left = new Node(5)
root.left.right = new Node(3)
root.right.left = new Node(4)
root.right.right = new Node(25)
root.left.right.left = new Node(10)
@courtneyfaulkner
courtneyfaulkner / devices.c
Created December 11, 2013 22:20
List OpenCL platforms and devices
#include <stdio.h>
#include <stdlib.h>
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif
int main() {