PApostol / PythonFun

A collection of various interesting exercises in Python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Having fun with Python3

Stand-alone code, including various algorithms and nice exercises.

-Sorting: Bubble, Insertion, Merge, Radix, Selection

Benching all the above sorting algorithms.

-Misc:

CheckParentheses.py:
	Checks string input for balanced parentheses (, [, {.

Decorators.py:
	Stacked decorators to elaborate on their usage.

GetPrimes.py:
	Given an integer n, return all prime numbers up to n.

MergeNamedtuples.py:
	Merge an arbitrary number of namedtuples to a new namedtuple.

MergeRanges.py:
	Given a list of tuples, merge the overlapping ranges as shown: [(1,6), (0,5), (7,10)] -> [(0,6), (7,10)]

PalindromicSubstrings.py:
	Finds longest palindromic substring using an O(n^2) implementation and Manacher's algorithm O(n), benchmarked.

Permutations.py:
	Given a list, print all possible permutations of its elements.

PrimeFactors.py:
	Given an integer n, return the prime factors of n. Two implementations, benchmarked.

Threads.py:
	A simple implementation of two threads.

sqlite3.py:
	Create a database and add input & output using sqlite3.

About

A collection of various interesting exercises in Python.


Languages

Language:Python 100.0%