Giter Site home page Giter Site logo

tusharchugh / ctci-modern_cplusplus Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 2.0 280 KB

Modern C++ based solutions for cracking the coding interview and leet code questions

License: MIT License

Python 1.60% C++ 98.40%
ctci-solutions ctci algorithms data-structures interview-preparation cplusplus benchmark gtest google modern-cpp

ctci-modern_cplusplus's Introduction

Algorithms and Data structure

Build Status

This repository contains the solutions to cracking the coding interview/LeetCode in C++. Most of the solutions available on other repositories are mostly follow C style coding. This repo attempts to follow modern C++ guidelines. In addition, this contains test cases and benchmarking to evaluate the correcting and the running time of the algorithms.

The build is based on Bazel offered by Google. It also uses Gtest for implementing test cases and google benchmarks for benchmarking running time.

Project structure

algorithms-practice
    ├──include
    │  └── arrays_strings
    │      ├── BUILD
    │      └── example.h
    │
    ├──tests
    │  ├── test
    │  │   └── arrays_strings
    │  │       └── example_test.cpp
    │  ├── benchmark
    │  │   └── arrays_strings
    │  │       └── example_benchmark.cpp
    │  └── BUILD
    ├──third_party
    │  ├── gtest.BUILD
    │  └── benchmark.BUILD
    └── WORKSPACE

Build Code (Inclduing gtest and google benchmark)

  1. Install bazel
  2. Install GCC-5 or above
  3. Make sure CC and CXX environment variables are pointing to the latest GCC version in /user/bin
  4. Clone this repository and enter the repo directory
  5. Build the code: bazel build ...

Run

  1. Run test cases: bazel run test:algorithms-test
  2. Run benchmarks: bazel run test:algorithms-benchmark

Add new files/test

  1. Do add new solution. Create a new 'example.h' file in the appropriate directory inside the include folder. Add corresponding test in test/'appropriate'/ directory. Do the same for benchmark

Todo's:

  1. Add log tools like google logs
  2. Add gsl (guideline support library)
  3. Add code coverage

ctci-modern_cplusplus's People

Contributors

jasmamu1992 avatar tusharchugh avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.