This repository contains the implementation for Lab 1 of the Advanced Data Structures (ADS) course: Large Integer Arithmetic Expression. The main goal of this project is to compute arithmetic expressions involving large integers that exceed the default data types' capacity in most programming languages.
- Support for Large Integers: Handles arithmetic operations for integers larger than standard data types (
int,long, etc.). - Expression Evaluation: Parses and evaluates arithmetic expressions including addition, subtraction, multiplication, and division.
- Input Validation: Checks for valid input expressions and provides error messages for invalid syntax or unsupported operations.
- Efficient Algorithms: Utilizes efficient data structures and algorithms to optimize computation for large numbers.
- A C++ compiler (e.g., GCC, Clang, MSVC)
- Basic knowledge of C++ programming
- C++ Standard Library
-
Compile the source code:
g++ 10422030.cpp -o 10422030
-
Run the program:
./10422030 tests.txt output_10422030.txt
- If you want to change the ID, you shoud change the code in .cpp file
- Input: Enter arithmetic expressions with large integers (e.g.,
12345678901234567890 + 98765432109876543210). - Output: The program will display the computed result.
Example:
Input: 99999999999999999999 * 88888888888888888888
Output: 8888888888888888888711111111111111111112
- BigInteger Class: Implements addition, subtraction, multiplication, and division for large integers using arrays or vectors to store digits.
- Expression Parsing: Uses stack-based parsing or recursive descent to evaluate arithmetic expressions.
This project is licensed under the Attribution-ShareAlike 4.0 International License.
- Author: Nguyen Lam Minh Hoa
- Instructor: Dr. Bui Van Thach
- Advanced Data Structures course materials
- Open-source C++ resources and tutorials
If you use this work, please cite:
Nguyen Lam Minh Hoa. (2025). Lab-1: Large Integer Arithmetic Expression (Software) [Version 1.0.1]. Zenodo. https://doi.org/10.5281/zenodo.1234567