private static int[] BubbleSort(int[] numbers)
{
for (var i = 0; i < numbers.Length - 1; ++i)
{
for (var j = 0; j < numbers.Length - (i - 1); ++j)
{
if (numbers[j] > numbers[j + 1])
{
(numbers[j], numbers[j + 1]) = (numbers[j + 1], numbers[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
# Navigate to the desired directory | |
cd 'C:\temp' | |
# Create a self-signed root certificate | |
$cert = New-SelfSignedCertificate -Type Custom -KeySpec Signature ` | |
-Subject "CN=AzureRoot" ` | |
-KeyExportPolicy Exportable ` | |
-HashAlgorithm sha256 ` | |
-CertStoreLocation "Cert:\CurrentUser\My" ` | |
-KeyUsageProperty Sign -KeyUsage CertSign |
let GenerateEventsOverYear = (startDatetime: datetime, endDatetime: datetime, intervalDays: int) {
let totalDays = datetime_diff('day', endDatetime, startDatetime);
let steps = totalDays / intervalDays;
range EventID from 1 to steps step 1
| extend EventTimestamp = startDatetime + ((EventID - 1) * intervalDays * 1d)
| where EventTimestamp <= endDatetime
| project EventID, EventTimestamp
};
let Events = GenerateEventsOverYear(ago(365d), now(), 7);
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
let arr = [ | |
// arr[0] | |
[ | |
// arr[0][0] | |
[ | |
// arr[0][0][0] | |
"unshift", | |
// arr[0][0][1] | |
[ | |
// arr[0][0][1][0] |
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 Graph { | |
constructor(isDirected = false, isWeighted = false) { | |
this.vertices = []; | |
this.isDirected = isDirected; | |
this.isWeighted = isWeighted; | |
} | |
addVertex(data) { | |
const newVertex = new Vertex(data); | |
this.vertices.push(newVertex); |
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 Graph { | |
constructor(isDirected = false, isWeighted = false) { | |
this.vertices = []; | |
this.isDirected = isDirected; | |
this.isWeighted = isWeighted; | |
} | |
addVertex(data) { | |
const newVertex = new Vertex(data); | |
this.vertices.push(newVertex); |
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 Graph { | |
constructor(isDirected = false, isWeighted = false) { | |
this.vertices = []; | |
this.isDirected = isDirected; | |
this.isWeighted = isWeighted; | |
} | |
addVertex(data) { | |
const newVertex = new Vertex(data); | |
this.vertices.push(newVertex); |
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 BinaryTree { | |
constructor(value, depth = 1) { | |
this.value = value; | |
this.depth = depth; | |
this.left = null; | |
this.right = null; | |
} | |
insert(value) { | |
if (value < this.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
const binarySearch = (arr, target) => { | |
let left = 0; | |
let right = arr.length; | |
while (right > left) { | |
const indexToCheck = Math.floor((left + right) / 2); | |
const checking = arr[indexToCheck]; | |
console.log(indexToCheck); | |
if (checking === target) { |
NewerOlder