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