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
/* Hash Table */ | |
var hash = (string, max) => { | |
var hash = 0; | |
for (var i = 0; i < string.length; i++) { | |
hash += string.charCodeAt(i); | |
} | |
return hash % max; | |
}; |
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
/* Binary Search Tree */ | |
class Node { | |
constructor(data, left = null, right = null) { | |
this.data = data; | |
this.left = left; | |
this.right = right; | |
} | |
} |
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
/* Binary Search Tree */ | |
class Node { | |
constructor(data, left = null, right = null) { | |
this.data = data; | |
this.left = left; | |
this.right = right; | |
} | |
} |
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
/* Queues */ | |
function Queue () { | |
collection = []; | |
this.print = function() { | |
console.log(collection); | |
}; | |
this.enqueue = function(element) { | |
collection.push(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
/* Sets */ | |
function mySet() { | |
// the var collection will hold the set | |
var collection = []; | |
// this method will check for the presence of an element and return true or false | |
this.has = function(element) { | |
return (collection.indexOf(element) !== -1); | |
}; | |
// this method will return all the values in the set |
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
/* Sets */ | |
function mySet() { | |
// the var collection will hold the set | |
var collection = []; | |
// this method will check for the presence of an element and return true or false | |
this.has = function(element) { | |
return (collection.indexOf(element) !== -1); | |
}; | |
// this method will return all the values in the set |
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 companies= [ | |
{name: "Company One", category: "Finance", start: 1981, end: 2004}, | |
{name: "Company Two", category: "Retail", start: 1992, end: 2008}, | |
{name: "Company Three", category: "Auto", start: 1999, end: 2007}, | |
{name: "Company Four", category: "Retail", start: 1989, end: 2010}, | |
{name: "Company Five", category: "Technology", start: 2009, end: 2014}, | |
{name: "Company Six", category: "Finance", start: 1987, end: 2010}, | |
{name: "Company Seven", category: "Auto", start: 1986, end: 1996}, | |
{name: "Company Eight", category: "Technology", start: 2011, end: 2016}, | |
{name: "Company Nine", category: "Retail", start: 1981, end: 1989} |
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
// C# program for Indexed Sequential Search | |
using System; | |
class Program { | |
static void sequentialSearch(int []arr, int n, int k) | |
{ |
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
from selenium import webdriver | |
from selenium.webdriver.support.ui import Select | |
import pyfiglet | |
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary | |
# from selenium.webdriver import Firefox | |
from selenium.webdriver.firefox.options import Options | |
from time import sleep |
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
<!-- | |
* Add your getform endpoint into "action" attribute | |
* Set a unique "name" field | |
* Start accepting submissions | |
--> | |
<form action="{getform-endpoint}" method="POST"> | |
<input type="text" name="name"> |