https://github.com/sweep76/cpplib
C++ Library (Combo)
https://github.com/sweep76/cpplib
algorithms cpp
Last synced: 11 months ago
JSON representation
C++ Library (Combo)
- Host: GitHub
- URL: https://github.com/sweep76/cpplib
- Owner: Sweep76
- Created: 2025-01-31T03:44:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-08T02:31:18.000Z (over 1 year ago)
- Last Synced: 2025-03-29T06:44:58.955Z (over 1 year ago)
- Topics: algorithms, cpp
- Language: C++
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CppLib(TEMP)
## Introduction
C++ Library
## Platform
* Linux
## Requirement
* g++ 6.3.0
* cmake 2.8.2
## Run
1. Clone
```bash
$ git clone https://github.com/zy2625/CppLib.git
```
2. Build
* Samples only:
```bash
$ mkdir build && cd build
$ cmake ..
$ make
```
* Additional tests:
```bash
$ mkdir build && cd build
$ cmake -DCPPLIB_BUILD_TEST=ON ..
$ make
```
3. Run
* targets:
* specific target
```bash
$ cd .. && ./bin/Stack ./data/tobe.txt
```
* custom target
```bash
$ make run
```
* tests:
* detailed output
```bash
$ cd .. && ./bin/Test
```
* test summary
```bash
$ make test
```
## Contents
* [Deque](#deque)
* [Queue](#queue)
* [Stack](#stack)
## Details
### Deque
* [Deque](https://github.com/zy2625/CppLib/blob/master/include/Deque.h)
#### Usage
```
$ more data/tobe.txt
to be or not to - be - - that - - - is
./bin/Deque data/tobe.txt
As queue: to be or not to be (2 left on deque)
As stack: to be not that or be (2 left on deque)
```
### Queue
* [Queue](https://github.com/zy2625/CppLib/blob/master/include/Queue.h)
#### Usage
```
$ more data/tobe.txt
to be or not to - be - - that - - - is
./bin/Queue data/tobe.txt
to be or not to be (2 left on queue)
```
### Stack
* [Stack](https://github.com/zy2625/CppLib/blob/master/include/Stack.h)
#### Usage
```
$ more data/tobe.txt
to be or not to - be - - that - - - is
./bin/Stack data/tobe.txt
to be or not to be (2 left on stack)
```
### Timer
* [Timer](https://github.com/zy2625/CppLib/blob/master/include/Timer.h)
#### Usage
```
./bin/Timer
Timestamp: 1499677940528
Timestamp: 1499677941023
It takes 0.495s to sum the sqrt 100000000 times
```