Skip to content

Instantly share code, notes, and snippets.

View sleebapaul's full-sized avatar
🏃‍♂️
Sprinting

Sleeba Paul sleebapaul

🏃‍♂️
Sprinting
View GitHub Profile
@sleebapaul
sleebapaul / binarySearchTree.py
Last active June 30, 2020 10:42
Arsenal for Binary Search Tree Adventures
class Node():
"""
Basic component of a Tree is a Node
"""
def __init__(self, value):
self.value = value
self.left = None
self.right = None
@sleebapaul
sleebapaul / adventuresWithTries.py
Created February 9, 2020 18:33
Adventures with Trie data structure
class Node():
def __init__(self, character):
self.letter = character
self.isEndOfWord = False
self.children = {}
class Trie:
def __init__(self):
"""
Initialize an empty Node as root.
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
response = openai.Completion.create(
model="text-davinci-002",
prompt="A bot that creates haikus. A haiku is a three or four lines short poem
which can be written in various contexts like life, philosophy, politics, current affairs,
life lessons, deep thinking, beauty, success, failure and many others.