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
using System; | |
using System.Threading.Tasks; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Hosting; | |
using Microsoft.Extensions.Logging; | |
class Program | |
{ | |
static Task Main(string[] args) | |
{ |
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
const fs = require( "fs" ) | |
const path = require( "path" ) | |
const { basename } = require( "path" ) | |
const fileDir = path.join( __dirname, "../../../fileConverter/files" ) | |
// Get all files' names | |
const getAllFiles = function ( dirPath, arrayOfFiles = [] ) { | |
files = fs.readdirSync( dirPath ) | |
arrayOfFiles = arrayOfFiles |
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
function pivot(arr, start = 0, end = arr.length - 1) { | |
const swap = (arr, idx1, idx2) => { | |
[arr[idx1], arr[idx2]] = [arr[idx2], arr[idx1]]; | |
}; | |
// We are assuming the pivot is always the first element | |
let pivot = arr[start]; | |
let swapIdx = start; |
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 PriorityQueue { | |
constructor(){ | |
this.values = []; | |
} | |
enqueue(val, priority){ | |
let newNode = new Node(val, priority); | |
this.values.push(newNode); | |
this.bubbleUp(); | |
} | |
bubbleUp(){ |
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 Node { | |
constructor(value){ | |
this.value = value; | |
this.left = null; | |
this.right = null; | |
} | |
} | |
class BinarySearchTree { | |
constructor(){ |
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 Node { | |
constructor(value){ | |
this.value = value; | |
this.left = null; | |
this.right = null; | |
} | |
} | |
class BinarySearchTree { | |
constructor(){ |
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 Node { | |
constructor(value){ | |
this.value = value; | |
this.next = null; | |
} | |
} | |
class Stack { | |
constructor(){ | |
this.first = null; |
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 Node { | |
constructor(value){ | |
this.value = value; | |
this.next = null; | |
} | |
} | |
class Queue { | |
constructor(){ | |
this.first = null; |
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 Node{ | |
constructor(val){ | |
this.val = val; | |
this.next = null; | |
this.prev = null; | |
} | |
} | |
class DoublyLinkedList { |
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 Node{ | |
constructor(val){ | |
this.val = val; | |
this.next = null; | |
} | |
} | |
class SinglyLinkedList{ | |
constructor(){ | |
this.head = null; |
NewerOlder