Skip to content

Instantly share code, notes, and snippets.

@xseano
xseano / LinkedList.cpp
Last active May 31, 2019 22:09
Linked List Remove Node
/**
* @brief Remove Node of data "T" from end of list
*
* @param targetData the data to remove from the list
*/
template <class T>
void LinkedList<T>::removeNode(T targetData)
{
if (head<T> == NULL)
{
@xseano
xseano / LinkedList.cpp
Last active May 30, 2019 01:05
Linked List Add Node
/**
* @brief Add Node of data "T" to end of list
*
* @param targetData the data to add to the list
*/
template <class T>
void LinkedList<T>::addNode(T targetData)
{
Node<T> *temp = new Node<T>(targetData); // create a temp Node
@xseano
xseano / Node.h
Last active May 30, 2019 00:52
Doubly Node
template <typename T>
struct Node
{
/**
* @brief the Node's data
*/
T data;
/**
* @brief the pointer to the next Node
@xseano
xseano / Node.h
Last active May 29, 2019 21:05
Node Creation
template <typename T>
struct Node
{
/**
* @brief the Node's data
*/
T data;
/**
* @brief the pointer to the next Node
@xseano
xseano / p01.cxx
Last active December 25, 2018 03:49
CS 211 (FALL) Project 1
// p01.cxx
// oberoi, sean
// ssoberoi
#include <iostream>
int getLargest(int values[], size_t length);
int main()
{
@xseano
xseano / lab12.cpp
Last active October 12, 2018 20:26
Lab 12
#include <iostream>
#include<fstream>
#define ARRAY_LEN 30
using namespace std;
float average(float* array, int num_elements);
int main()
{
@xseano
xseano / p02.cpp
Last active October 3, 2018 20:57
Project 2
#include <iostream>
#include <iterator>
#define CHOICE_RANGE 3
#define VECTOR_LEN 3
using namespace std;
struct Player
{
@xseano
xseano / pointer.cpp
Last active August 6, 2018 16:44
Basic C++ Program Demonstrating Pointers
#include <iostream>
#include "tgmath.h"
using namespace std;
void checkAge(int*);
int main()
{
cout << "Enter your age: ";
@xseano
xseano / calc.cpp
Last active August 6, 2018 16:43
C++ Calculator
#include <iostream>
using namespace std;
class Token
{
public:
char kind;
double value;
Token (char ch)
@xseano
xseano / intval.cpp
Last active July 1, 2018 18:41
Chapter 6 #9
#include <iostream>
#include "tgmath.h"
// For the sake of not having to prepend datatypes with std:: :P
using namespace std;
int main ()
{
cout << "Enter a number 1-4 digits: ";
string num;