An open API service indexing awesome lists of open source software.

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)

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
```