postfix-thumb

Academic

Postfix++ Calculator CLI (ADS2 Midterm)

2026

Grade Ā· 90/100

About this project

A command-line postfix (Reverse Polish Notation) calculator built in Node.js for CM2035 Algorithms and Data Structures 2 midterm (University of London). Expressions are evaluated left-to-right with a stack: literals and variables are pushed, operators pop their operands, compute, and push the result back. Features: šŸ“š Stack-based evaluation engine with a tokeniser backed by a hand-rolled dynamic array šŸ”¢ Arithmetic operators: + - * / % ^ and // (integer division) 🧮 Math helpers: MIN, MAX, AVG, GCD, LCM, HYPOT, ROUND, TRUNC šŸ“ Unary functions: NEG, ABS, SQRT, trig and hyperbolic functions, FACT, FIB, EXP, LN, LOG10 šŸ”¤ Variables A–Z stored in a fixed-size symbol table with a 26-slot ASCII hash: assign with =, query with ?, delete with # šŸ’» Interactive REPL (Postfix++ >>>) built on Node readline Going beyond the spec: - Dozens of operators and math functions well past the required arithmetic set - Course-style decomposition with pseudocode for the stack, dynamic array, hash table, and handlers

Tech stack

  • Node.js
  • JavaScript
  • Data Structures
  • Algorithms