Coder Social home page Coder Social logo

manid2 / dsa Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 175 KB

Data structures and algorithms code.

Home Page: http://manid2-dsa.readthedocs.io/

License: GNU General Public License v3.0

C++ 58.43% C 4.51% Python 31.86% Makefile 4.60% Shell 0.60%
algorithms data-structures interview leetcode leetcode-solutions

dsa's Introduction

Data structures and algorithms (DSA)

The purpose of this repository is to help me prepare for online assessments, programming competitions and software engineering interviews along with the benefit of practicing in the programming language I currently (year 2024) work in i.e. C++.

I had used C and Python 3 for previous practice sessions so that code is retained but no new code is pushed due to me using C++ full time so I gain expertise in that.

For these practice programs I have borrowed working code from various online sources and relevant credits are given in code comments. So I hope anyone who finds this repository may use it for their own learning of data structures and algorithms. After learning from working solutions in this repository you may practice solving problems on coding contest platforms with time limit.

Use the code and documentation in this repository freely and share it with the others.

Coding guidelines

  • Focus on C++ code and for online assessments, coding competition especially for platforms such as HackerRank, LeetCode.

  • Fully working single source files with no external dependencies as required for coding competitions.

  • Every C++ source file must build & run as a single file target the focus is on solving the problem correctly.

  • Each C++ compiled binary must output test result as a single line in this fomrat Executed M implementations with N tests.. This makes it easy to get tests summary.

  • For debugging each binary must print test name, test case number with input and output in this format and only when enabled with environment variable SHOW_TEST_OUTPUT:

    Testing implementation M <Name>
      test-0:  input: <i1 = v1>, <iX = vX>  output: <o = v>
      ...
      test-N:  input: <i1 = v1>, <iX = vX>  output: <o = v>
    Executed M implementations with N tests.
    
  • Must use latest C++ version (as of now C++20) to be updated with the latest additions, improvements to C++ and STL library.

Build & test

This repository uses Gnu Makefile to run build and test tasks along with some helper tasks such as to run formatter, linter for source code.

Examples

make venv # setup python virtual environment
make docs # generate sphinx docs

make cpp/arrays/2sum-01        # build a test binary from .cpp source file
make cpp/arrays/2sum-01-check  # run the test binary
make cpp/arrays/2sum-01-format # format .cpp source file

SHOW_TEST_OUTPUT=1 make cpp/arrays/2sum-01-check # run test with debug output

dsa's People

Contributors

manid2 avatar

Stargazers

David Leal avatar Sarah avatar

Watchers

 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.