Skip to content

Instantly share code, notes, and snippets.

View phitrann's full-sized avatar
💭
I may be slow to respond.

Tran Hoang Anh Phi phitrann

💭
I may be slow to respond.
View GitHub Profile
@phitrann
phitrann / MIPSFactorial.s
Created April 17, 2022 11:25 — forked from Peng-YM/MIPSFactorial.s
Factorial recursive version written in MIPS
.data
prompt: .asciiz "Input an integer x:\n"
result: .asciiz "Fact(x) = "
.text
main:
# show prompt
li $v0, 4
la $a0, prompt
syscall
# read x
@phitrann
phitrann / stringReverse.s
Created April 1, 2022 09:42 — forked from tombasche/stringReverse.s
Run in Spim or Mars to reverse a string with assembler! (MIPS)
# Mips program to reverse a string
# mips.s
.data
str: .space 128 # character buffer
.text
.globl main
@phitrann
phitrann / polynomial-dense-c++
Created March 28, 2022 11:16 — forked from birshert/polynomial-dense-c++
Polynomial class C++ based on vector - keeping all coefficients from 0 to maximum
#include <algorithm>
#include <iostream>
#include <vector>
#include <utility>
template <typename T>
class Polynomial {
private:
std::vector<T> data;
@phitrann
phitrann / Queue.cpp
Created March 21, 2022 06:25 — forked from ldclakmal/Queue.cpp
Queue using Linked List
// LinkedList_OOP_Queue.cpp : Defines the entry point for the console application.
// L.D.C.Lakmal
#include "stdafx.h"
#include <iostream>
using namespace std;
typedef int E;
class Node {
@phitrann
phitrann / Stack.cpp
Created March 21, 2022 06:25 — forked from ldclakmal/Stack.cpp
Stack using Linked List
// LinkedList_OOP_Stack.cpp : Defines the entry point for the console application.
// L.D.C.Lakmal
#include "stdafx.h"
#include <iostream>
using namespace std;
typedef int E;
class Node {