Skip to content

VarunS2002/Python-Data-Structures-Algorithms

Repository files navigation

Python-Data-Structures-Algorithms

Repository for Data Structures and Algorithms in Python.

These programs can be imported and used as modules in your programs.

Programs:

  1. matrix_operations.py

    • Mathematical operations on Matrices
    • Addition
    • Subtraction
    • Scalar Multiplication
    • Multiplication
    • Transpose
    • Identity
  2. stack.py

    • Stack Data Structure
    • Push
    • Pop
    • Top
  3. binary_tree_traversal.py

    • Traverse Binary Trees
    • Without any order
    • Pre order
    • In order
    • Post order
  4. tower_of_hanoi_stack.py

    • Tower of Hanoi puzzle
    • Display Steps
    • Uses Stack DS from stack.py as Rods
  5. factorial.py

    • Factorial of a Positive Integer
    • Iteration (for & while)
    • Recursion
  6. factors.py

    • Factors of Non-Zero Integers
    • Iteration (for & while)
    • Recursion
  7. permutations_combinations.py

    • Permutations & Combinations
    • nPr
    • nCr
    • Uses factorial.py for calculating factorials
  8. pascal_triangle.py

    • Pascal's Triangle
    • Uses permutations_combinations.py for calculating nCr
  9. sorting.py

    • Sorting List of Floats and/or Integers
    • Quick Sort
    • Merge Sort
    • Selection Sort
    • Insertion Sort
    • Bubble Sort
  10. sorting_time_comparison.py

    • Compare Time Complexity of Sorting Algorithms
    • Show Scores
    • Plot a Graph
    • Uses sorting.py for sorting algorithms
  11. searching.py

    • Searching within a List
    • Linear Search
    • Binary Search
    • Uses sorting.py for the sorting algorithm
  12. queue.py

    • Queue Data Structure
    • Single Ended Queue
    • Double Ended Queue
    • Enqueue
    • Dequeue