Skip to content

cxxx1828/Python-data-structures-algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Structures and Algorithms in Python

This repository contains comprehensive Python implementations of fundamental data structures and algorithms, featuring binary trees with insertion, deletion, and traversal operations (in-order, pre-order, post-order), heap data structures with heapify, heap sort, and priority queue operations, and graph representations with depth-first search (DFS), breadth-first search (BFS), and shortest path algorithms. The collection includes various sorting algorithms such as merge sort, quick sort, heap sort, and insertion sort, each with detailed time complexity analysis ranging from O(n log n) average case to O(n²) worst case scenarios. The graph implementations demonstrate real-world applications through social network analysis, where vertices represent users and edges represent friendships, with algorithms to classify users into groups based on connection counts and find paths between nodes. Binary tree operations showcase balanced and unbalanced tree handling, node search with O(log n) average complexity, and complete tree traversal methods. Heap implementations include both min-heap and max-heap structures with efficient insert and extract operations maintaining heap property in O(log n) time. Each algorithm includes practical examples, test cases, and performance analysis comparing best, average, and worst-case scenarios. The code is structured for educational purposes with clear comments, proper object-oriented design using classes for Vertex, Edge, Node, and Graph structures, and demonstrations of how these fundamental algorithms apply to real-world problems like social network analysis, priority scheduling, and data organization. Time complexity analysis covers space-time tradeoffs, recursive vs iterative approaches, and optimization techniques for improving algorithm performance in various scenarios.

Features

  • Binary Search Trees with insertion, deletion, search (O(log n) average)
  • Heap data structures with heapify and priority queue operations
  • Graph algorithms: DFS, BFS with O(V + E) complexity
  • Sorting: Merge Sort, Quick Sort, Heap Sort with complexity analysis
  • Social network modeling and friend group classification
  • Path finding and graph traversal algorithms
  • Complete time and space complexity documentation

Author

Nina Dragićević

About

Python implementations of fundamental data structures and algorithms including binary trees, heaps, and graphs with sorting algorithms, traversal methods, and time complexity analysis for educational purposes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages