This file contains 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 django.http import HttpResponse | |
def index(request): | |
return HttpResponse("Hello, world. You're at the polls index.") |
This file contains 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
class BST_Tree { | |
Node nodeHead; | |
/** | |
* @param customRoot The custom node is a root that will be calculate number of sub trees from that | |
*/ | |
int countSubTree(Node customRoot) { | |
if (customRoot.left != null && customRoot.right != null) { | |
int subTreeLeft = countSubTree(customRoot.left); | |
int subTreeRight = countSubTree(customRoot.right); |
This file contains 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
#define MIN(a, b) a < b ? a : b | |
void changeSize(int* &arr, int &size, int newSize) { | |
// Allocate a new array | |
int* newArray = new int[newSize]; | |
// Copy all elements to the new array | |
for(int i = 0; i < MIN(size, newSize); ++i) { | |
newArray[i] = arr[i]; | |
} | |
// Free and assign the new Array |
This file contains 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
import random | |
import string | |
# whitespace – a string containing all ASCII whitespace | |
# ascii_lowercase – a string containing all ASCII lowercase letters | |
# ascii_uppercase – a string containing all ASCII uppercase letters | |
# ascii_letters – a string containing all ASCII letters | |
# digits – a string containing all ASCII decimal digits | |
# hexdigits – a string containing all ASCII hexadecimal digits |
NewerOlder