Skip to content

Instantly share code, notes, and snippets.

View clarkngo's full-sized avatar
🏠
Working from home

Clark Ngo clarkngo

🏠
Working from home
  • eBay
  • Bellevue
View GitHub Profile
from keras.datasets import mnist
(train_images, train_labels), (test_images, test_labels) = mnist.load_data()
from keras import models
from keras import layers
network = models.Sequential()
network.add(layers.Dense(512, activation='relu', input_shape=(28 * 28,)))
network.add(layers.Dense(10, activation='softmax'))
network.compile(optimizer='rmsprop',
loss='categorical_crossentropy',
from keras.datasets import mnist
(train_images, train_labels), (test_images, test_labels) = mnist.load_data()
digit = train_images[4]
import matplotlib.pyplot as plt
plt.imshow(digit, cmap=plt.cm.binary)
plt.show()
@clarkngo
clarkngo / df_search.cpp
Created September 5, 2019 07:48
Depth First Search for C++
// C++ program to print DFS traversal from
// a given vertex in a given graph
#include<iostream>
#include<list>
using namespace std;
// Graph class represents a directed graph
// using adjacency list representation
class Graph
{
@clarkngo
clarkngo / binary_heap.cpp
Created September 5, 2019 07:40
Binary Heap for C++
#include<iostream>
#include<climits>
using namespace std;
// Prototype of a utility function to swap two integers
void swap(int *x, int *y);
// A class for Min Heap
class MinHeap
{
@clarkngo
clarkngo / b_search_tree.cp
Created September 5, 2019 07:33
Binary Search Tree for C++
#include <iostream>
struct node
{
int key;
struct node *left, *right;
};
// A utility function to create a new BST node
struct node *newNode(int item)
@clarkngo
clarkngo / t_traverse.cpp
Created September 5, 2019 07:27
Tree Traversal for C++
// C program for different tree traversals
#include <iostream>
using namespace std;
/* A binary tree node has data, pointer to left child
and a pointer to right child */
struct Node
{
int data;
struct Node* left, *right;
@clarkngo
clarkngo / binary_tree.cpp
Created September 5, 2019 07:21
Binary Tree for C++
#include <iostream>
using namespace std;
struct node
{
int data;
struct node *left;
struct node *right;
};
/* newNode() allocates a new node with the given data and NULL left and
@clarkngo
clarkngo / q_sort.cpp
Created September 5, 2019 07:05
Quick Sort for C++
#include <iostream>
using namespace std;
// A utility function to swap two elements
void swap(int* a, int* b)
{
int t = *a;
*a = *b;
*b = t;
}
@clarkngo
clarkngo / h_table
Created September 5, 2019 06:55
Hash Table for C++
#include <iostream>
using namespace std;
//template for generic type
template<typename K, typename V>
//Hashnode class
class HashNode
{
public:
@clarkngo
clarkngo / package.json
Created September 2, 2019 08:38
01_using_package_json
{
"author": "Clark Ngo",
"name": "fcc-learn-node-with-express",
"version": "0.1.0",
"dependencies": {
"express": "^4.14.0",
"body-parser": "^1.15.2",
"cookie-parser": "^1.4.3",
"fcc-express-bground": "https://github.com/Em-Ant/fcc-express-bground-pkg.git"
},