Skip to main content

dsatantra

A Python package providing clean C++ and Python implementations for 40 classic Data Structures and Algorithms (DSA) problems. Useful for competitive programming, template generation, exam revision, and learning.

Installation

pip install dsatantra

Quick Start

from dsatantra import dsa_search, dsa_cpp, dsa_python

# 1. Search & list all 40 available DSA problems
dsa_search()

# 2. Get C++ code for a specific problem (e.g. Problem 1)
cpp_code = dsa_cpp(1)

# 3. Get Python code for a specific problem (e.g. Problem 34)
py_code = dsa_python(34)

Available Functions

  • dsa_search(): List all available problems with their numerical IDs.
  • dsa_cpp(problem_num): Retrieve the C++ solution for problem number problem_num.
  • dsa_python(problem_num): Retrieve the Python solution for problem number problem_num.

(Note: dsatantra_search() and dsatantra_get() are also supported for backward compatibility).

Available Problems (1 - 40)

  1. Binary Search (Basic Iterative with Sorting)
  2. Merge Sort (Basic)
  3. Quick Sort (Basic)
  4. Binary Search using Divide and Conquer
  5. First and Last Occurrence of Element in a Sorted Array
  6. Merge Sort with Recursion & Comparison Tracking
  7. Inversion Pairs Count using Merge Sort
  8. Quick Sort with Calls & Comparison Tracking
  9. Contiguous Subarray with Largest Sum (Kadane's Algorithm)
  10. Kth Largest Element in an Array (Min Heap)
  11. Missing Number of the Sequence
  12. Merge Sorted Array
  13. Longest Binary Subarray after K Flips
  14. Sorting by Set Bit Count using Divide and Conquer
  15. Book Allocation with Minimum Maximum Load
  16. Minimum Element in Rotated Sorted Array
  17. Search in Rotated Sorted Array
  18. Koko Eating Bananas
  19. Single Number
  20. Kth Missing Positive Number
  21. Merge Two Sorted Linked Lists
  22. Basic Hash Table Implementation
  23. Hash Table with Double Hashing
  24. Hash Table with Linear Probing
  25. Hash Table with Quadratic Probing
  26. Count Frequencies of Elements using Hashing
  27. Check Nearby Duplicates using Hashing
  28. Check for Pair with Given Sum using Hashing
  29. Count Distinct Elements in Every Window of Size K
  30. Top K Frequent Elements
  31. Group Anagrams
  32. Find Pair of Numbers with Target Sum
  33. Hash Table with Separate Chaining
  34. Maximum XOR Subarray with Hashing
  35. Least K Elements
  36. Count Distinct Elements in Every Window of Size K
  37. Debugging Minimum Element using Divide and Conquer
  38. Debugging Merge Sorted Array
  39. Debugging Kth Smallest Element
  40. Debugging Hash Table - Linear Probing

Release files for dsatantra 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dsatantra 1.2.1
File Size Uploaded
dsatantra-1.2.1.tar.gz 13.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dsatantra 1.2.1
File Interpreter ABI Platform
dsatantra-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 26.6 kB

Release files / dsatantra-1.2.1.tar.gz

Download URL dsatantra-1.2.1.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d14bfdcb062c99528475fe85e3473a840895efd02ac67f93e2b6bfc5ccb1fd8e
BLAKE2b-256 checksum
How to use checksums
aa22b5ebf1c3cf2d98ee93574f9478c3976d8657c1d9c943ee7df92a1e33b829
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release files / dsatantra-1.2.1-py3-none-any.whl

Download URL dsatantra-1.2.1-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa27d18f7867215954bc221a3f29f5215b94ea35bedacfb036147fc62b875b5c
BLAKE2b-256 checksum
How to use checksums
f2e83b9085618b4b75c6aaecea12ce6c6579ce9d14ef092a9300d1355f4a6d7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release history Release notifications | RSS feed

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page