Data Structures and Algorithm Programming using Python
In this project, different algorithms are implemented using the Python programming language for the ICT1018: Data Structures and Algorithms course, forming part of my BSc Computer Science.
Task Breakdown
In this project, the following 12 tasks were implemented:
-
Integer arrays are randomly generated and sorted using:
- Shell Sort
- Quick Sort
-
The sorted pair of arrays from the previous task is merged in linear time.
-
An integer array is randomly generated and any extreme elements are returned.
An element is considered extreme if:-
it is not the first, nor the last element of its array AND
-
is either
- less than its successor and predecessor OR
- greater than its successor and predecessor
Eg:
A = [0, 5, 3, 6, 8, 7, 15, 9] extremePoints(A) -> 5, 3, 8, 7, 15
-
-
An integer array is randomly generated and all 2-pairs of integers are returned.
A 2-pair refers to any 2 distinct pairs of integers ((a,b),(c,d)) where a X b = c X d and a ≠ b ≠ c ≠ d. -
An ADT Stack is used to evaluate arithmetic expressions in RPN format.
Available Operands: +, -, x, and /. -
The Sieve of Eratosthenes algorithm is implemented and a given number is checked if it is prime.
-
An unbalanced BST (Binary Search Tree) is built from user input and displayed.
-
The Newton-Raphson Method is used to approximate the square root of a given number.
-
An integer array is randomly generated and all repeating integers are returned in the fastest and most memory-efficient way possible.
-
An integer array is randomly generated and the largest integer is returned.
-
The first n terms of the Maclaurin Series Expansion are used to compute the:
- COSINE
- SINE
-
The sum of the first n terms of the Fibonacci Sequence are computed.
Documentation
A report describing the design process and motivation behind this project can be found here.
A detailed technical documentation of the source code written can be found here.