A Pen by Himanshu Singh on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// re is regular expression | |
import re | |
print("Our Magical Calculator") | |
print("Type 'quit' to exit\n") | |
previous = 0 | |
run = True | |
def performMath(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
from PIL import Image | |
from io import BytesIO | |
import os | |
def start_search(): | |
search = input("search for: ") | |
params = {"q": search} | |
dir_name = search.replace(" ", "_").lower() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Program to set border in a given image | |
// SimpleImage class exist in dukelearntoprogram | |
var image = new SimpleImage("smallpanda.png"); | |
// thickness of border required | |
var thickness = 10; | |
// function which set the pixel received to black; | |
function setBlack(pixel){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// c++ | |
struct Node | |
{ | |
int key; // value in node | |
Node *left, *right; // stores left/right child | |
bool rightThread; // stores right Thread for node exists or not | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// c++ | |
if (curr->key > el) // curr is a variable maintaining current node(already present in tree) | |
// with which comparison is taking place | |
// And, el is new key we have to insert | |
{ | |
successor = curr; // successor only contain value if new node | |
// goes in left subtree of curr node | |
curr = curr->left; // go left subtree | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (curr->key < el) | |
{ | |
if (curr->rightThread) // if current node has rightThread == true | |
{ | |
curr->right = NULL; // make right child null of current node | |
curr->rightThread = false; // change value of rightThread for current node from true to false | |
} | |
curr = curr->right; // go right subtree | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// adding thread | |
if (successor) // if successor is not NULL | |
{ | |
// newNode stores data of new node | |
newNode->right = successor; // store successor value in right child of newNode | |
newNode->rightThread = true; // makes rightThread valur of new Node to true | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
optimization of fibonacci numbers implementation | |
time comlexity : O(n) rather than exponential ,as in older recursive implementation. | |
*/ | |
int fib(int n, int memo[]) | |
{ | |
if (memo[n] == -1) // if we encounter this number first number, as memo[] is initialized with -1 | |
{ | |
int res; | |
if (n == 0 || n == 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- https://github.com/ayan-biswas0412/gssoc2021-HotelOnTouch/pull/161 | |
- https://github.com/Manthan933/Manthan/pull/169 | |
- https://github.com/DhairyaBahl/React-Messenger-App/pull/43 | |
- https://github.com/DhairyaBahl/React-Messenger-App/issues/170 |
OlderNewer