Computer Science Concepts

Welcome to the "Computer Science Concepts" repository! This repository contains practical challenges that I have written in Python. These challenges are designed to help practicing and improving my knowledge of the Python language, algorithms, time-space complexity (Big O Notation), and various data structures commonly used in programming.

Challenges

The challenges in this repository cover a range of topics, including:

  • Array Reversal: Reverses an array. Time complexity: O(n).
  • Palindrome Checker: Checks whether a string is a palindrome. Time complexity: O(n).
  • Binary Search: Performs a binary search on a sorted array. Time complexity: O(log n).
  • Quick Sort: Sorts an array using the Quick Sort algorithm. Time complexity: O(n log n) on average, O(n^2) in the worst case.
  • Hash Table Implementation: Implements a hash table data structure. Time complexity: O(1) on average, O(n) in the worst case.
  • Binary Tree Traversal: Performs various traversals on a binary tree. Time complexity: O(n).

Quick Sort

The Quick Sort method is a widely used sorting algorithm that follows the divide-and-conquer approach. It has the following time complexity:

  • Average case: O(n log n)
  • Worst case: O(n^2)

The Quick Sort algorithm has a good average case time complexity and is often used in practice due to its efficiency. However, in the worst case, it can have a quadratic time complexity. Efforts have been made to mitigate this issue by using randomized partitioning or choosing a good pivot element.

Usage

  1. Clone the repository: git clone https://github.com/your-username/Computer-Science-Concepts.git.
  2. Navigate to the repository: cd Computer-Science-Concepts.
  3. Open the individual challenge files in your preferred Python editor.

Contributing

Please, feel free to provide constructive feedback regarding the content of this repository by sending an e-mail.

License

The code in this repository is available under the MIT License.