Giter Club home page Giter Club logo

prostopay's Introduction

Task 1: Implementation README

Implementation Notes

1. Python Dict-Like Hashmap

I have implemented a Python dictionary-like hashmap for Task 1.

2. Customizable Capacity

You can choose the capacity of the hashmap; however, it will automatically increase if it's filled up to 70% of its capacity. This behavior is similar to Python's defaultdict.

3. Memory Optimization

To optimize memory usage, I initialize the hashmap with a list of None values. This approach consumes less memory initially compared to a fully populated list. However, this can impact speed because we need to check if an element is filled or not, which doubles the time required to put elements.

4. Efficiency

Python lists have O(1) time complexity for most operations, making our hashmap efficient.

Usage

To use this implementation, follow these steps:

  1. Make sure you have Python 3.10 installed on your system.

  2. Create a virtual environment (venv) for this project:

    python3.10 -m venv venv
  3. Activate the virtual environment:

    • On Windows:
      venv\Scripts\activate
    • On macOS and Linux:
      source venv/bin/activate
  4. Install the required packages:

    pip install -r requirements.txt
  5. Run the tests for Task 1 located in the "task1" folder:

    python task1/test_task1.py

Task 2: Implementation README

Implementation Notes

1. Testing with Unittest

For Task 2, I have chosen to use the unittest library for testing.

2. In-Memory Database

I've opted for an in-memory database for testing purposes, as it's faster and more suitable for testing scenarios.

Usage

To use this implementation, follow these steps:

  1. Make sure you have Python 3.10 installed on your system.

  2. Create a virtual environment (venv) for this project:

    python3.10 -m venv venv
  3. Activate the virtual environment:

    • On Windows:
      venv\Scripts\activate
    • On macOS and Linux:
      source venv/bin/activate
  4. Install the required packages:

    pip install -r requirements.txt
  5. Run the tests for Task 2 located in the "task2" folder:

    python task2/test_task2.py

These steps will help you set up and test the implementations for both Task 1 and Task 2.

prostopay's People

Contributors

nazarmp avatar nazikm 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.