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.0

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.0
File Size Uploaded
dsatantra-1.2.0.tar.gz 13.7 kB Details

Built distribution (wheel)

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

Total release size: 26.7 kB

Release files / dsatantra-1.2.0.tar.gz

Download URL dsatantra-1.2.0.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
95be43763fe52e2bdea84300a09e2d08b73f15f4985c41c33667f032f8020bf8
BLAKE2b-256 checksum
How to use checksums
04176ddb0c787b51e3249d8481f1eae2f8038c49bea966c3adfcca3a6ca7ff53
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.0-py3-none-any.whl

Download URL dsatantra-1.2.0-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52995dcd3a51d430b8cdec481319de5ef239038b5955f7dafeae117d86e2dddb
BLAKE2b-256 checksum
How to use checksums
e26c621faa6b80eebe8b8e2a7de501a492176a2ddfae141a029efb5574ae9b14
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

1.2.1

2 release files

This release

1.2.0 This release

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