Skip to content

Instantly share code, notes, and snippets.

View sudhanshuptl's full-sized avatar
🦴
Focusing

Sudhanshu patel sudhanshuptl

🦴
Focusing
View GitHub Profile
@sudhanshuptl
sudhanshuptl / Bubble_Sort.py
Last active June 11, 2018 12:31
Different Sorting Algorithms in Python
# Bubble sort in python
__author__ ='Sudhashu Patel'
class BubbleSort:
def __init__(self, ls=[5,3,6,2,4,7,4,3]):
self.ls = ls
self.length = len(self.ls)
def sort(self, reverse=False):
if reverse:
@sudhanshuptl
sudhanshuptl / BinarySearchTree.py
Last active May 22, 2018 07:15
Complete Binary tree in python (using oops ). Also defined many different operations and algorithms for it.
__author__='Sudhanshu Patel'
'''
Binary search tree implementation
# goes left if key less than node.key else right
1. insetion
2. Preorder
3. postorder
4. inorder traversal
5. find max depth
6. print all leaf node
@sudhanshuptl
sudhanshuptl / BinarySearchTree.py
Last active May 10, 2022 09:38
Binary Search tree implementation in python ( oops approach )
__author__='Sudhanshu Patel'
'''
Binary search tree implementation
# goes left if key less than node.key else right
1. insetion
2. Preorder
3. postorder
4. inorder traversal
5. find max depth
6. print all leaf node
@sudhanshuptl
sudhanshuptl / OneWayLinkList.py
Last active May 30, 2018 06:55
One way Link List : implementation in python
@csaez
csaez / guess_the_number.py
Last active December 17, 2015 04:49
Interactive Programming in Python - Mini-project #2: "Guess the number" game
# Mini-project #2 - "Guess the number"
#
# 'Introduction to Interactive Programming in Python' Course
# RICE University - coursera.org
# by Joe Warren, John Greiner, Stephen Wong, Scott Rixner
import simplegui
import random
# initialize global variables used in your code