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
var binarySearch = function(array, value) { | |
var guess, | |
min = 0, | |
max = array.length - 1; | |
while(min <= max){ | |
guess = Math.floor((min + max) /2); | |
if(array[guess] === value) | |
return guess; | |
else if(array[guess] < value) |
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
var selectionSort = function(array) { | |
var temp; | |
for(var i=0; i<array.length; i++){ | |
var mi = i; | |
for(var j = i + 1; j<array.length; j++) { | |
if(array[j] < array[mi]) | |
mi = j; | |
} |
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
# Definition for singly-linked list. | |
# class ListNode: | |
# def __init__(self, val=0, next=None): | |
# self.val = val | |
# self.next = next | |
class Solution: | |
def mergeKLists(self, lists: List[ListNode]) -> ListNode: | |
self.lists = lists |
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
#include <bits/stdc++.h> | |
using namespace std; | |
#define F first | |
#define S second | |
#define endl '\n' | |
#define PB push_back | |
typedef long long ll; | |
typedef vector<ll> vll; |
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
#include <bits/stdc++.h> | |
using namespace std; | |
#define F first | |
#define S second | |
#define endl '\n' | |
#define PB push_back | |
typedef long long ll; | |
typedef vector<ll> vll; |
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
#include <bits/stdc++.h> | |
using namespace std; | |
#define F first | |
#define S second | |
#define endl '\n' | |
#define PB push_back | |
typedef long long ll; | |
typedef vector<ll> vll; |
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
#include <bits/stdc++.h> | |
using namespace std; | |
#define F first | |
#define S second | |
#define endl '\n' | |
#define PB push_back | |
typedef long long ll; | |
typedef vector<ll> vll; |
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
#include <bits/stdc++.h> | |
using namespace std; | |
#define F first | |
#define S second | |
#define endl '\n' | |
#define PB push_back | |
typedef long long ll; | |
typedef vector<ll> vll; |
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
#include <bits/stdc++.h> | |
using namespace std; | |
#define F first | |
#define S second | |
#define endl '\n' | |
#define PB push_back | |
typedef long long ll; | |
typedef vector<ll> vll; |
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
#include <bits/stdc++.h> | |
using namespace std; | |
#define F first | |
#define S second | |
#define endl '\n' | |
#define PB push_back | |
typedef long long ll; | |
typedef vector<ll> vll; |
NewerOlder