/misc_exercises-py

Miscellaneous other exercises (such as building linked lists and the Sieve of Eratosthenes), done in Python 2.7.12.

Primary LanguagePythonMIT LicenseMIT

misc_exercises-py

This is a repository for miscellaneous other coding exercises, implemented in Python 2.7.12. This repository contains the following files:

Shukla - Battleship

A simple implementation of the game Battleship.

Shukla - Linked Lists

An implementation of linked lists, a standard data structure useful especially in some lower-level languages such as C.

Shukla - Monte Carlo Approximation of Pi by Direct Sampling (Uniform Distribution)

An approximation of the value of π by Monte Carlo simulation with direct sampling.

Shukla - Sieve of Eratosthenes

An implementation of the Sieve of Eratosthenes, which is then used to generate the prime factorisation of a given number.

Shukla - Three Vec

A class of vectors in the vector space ℝ^3 defined with the L^2 (Euclidean) metric. This supports the methods of vector addition and subtraction, scalar multiplication and division, dot and cross products, magnitudes, the creation of unit vectors, component-by-component comparison, and parity. Two-vectors are then defined as a daughter class with the same methods;