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
| class LinkedStack: | |
| def __init__(self): | |
| self._head = None | |
| self._size = 0 | |
| class _node: | |
| __slots__ = '_element', '_nextP' | |
| def __init__(self, element, nextP): | |
| self._element = element |
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
| def quicksort(S): | |
| if len(S)<2: | |
| print("[RETURNED]length of list less than 2") | |
| return | |
| pivot = S[-1] | |
| print("[INFO] pivot: ", pivot) | |
| L = [] | |
| G = [] |
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
| ## DIVIDE -> mergesort | |
| ## CONQUER -> mergesort | |
| ## COMBINE -> merge | |
| def merge(S1, S2, S): | |
| ''' | |
| S1-> First sorted seq | |
| S2-> Second sorted seq | |
| S -> Original seq | |
| ''' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| import cv2 | |
| from scipy.spatial import distance as dist | |
| import numpy as np | |
| def resize(image, width=None, height=None, inter=cv2.INTER_AREA): | |
| dim = None | |
| (h, w) = image.shape[:2] | |
| # check to see if the width is None | |
| if width is None: |
NewerOlder