Skip to content

Instantly share code, notes, and snippets.

View tannaurus's full-sized avatar
🏠
Working from home

Tanner Gill tannaurus

🏠
Working from home
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<!-- Calendly badge widget begin -->
<link href="https://assets.calendly.com/assets/external/widget.css" rel="stylesheet">
//Iterative versions of https://gist.github.com/tparveen/edddf988ec68ef6bb74cff9d1284d09d
//Exercise 1 - Counting Sheep
//Write an iterative algorithm that counts how many sheep jumps over the fence. Your program should take a number
//as an input. That number should be the number of sheep you have. The program should diplay the number along
//with the msg "Another sheep jumps over the fence" until no more sheep left.
function countSheepLoop(num){
for(let i=num; i>0; i--){
console.log(`counting sheeps ${i}`);
//For each one these exercises identify the Big O. Once you have done so, put a counter
//variable and now check to see how the counter related to understanding the Big O for
//each of these algorithms.
/*=================================================================================
/*
Your task is to step through the code thoughly with
the input provided. You should be able to describe what is happening in each step.
Identify the Big O of this algorithm and be able to explain your answer.
Finally use a counter to show how your the counter can be helpful in understanding the
@tannaurus
tannaurus / Big 0 Drills
Created July 25, 2017 16:15
Identify the Big 0 of basic algorithms
Drill #1:
function isEven(value){
if (value % 2 == 0){
return true;
}
else
return false;
}
// O(1) Constant, because it was arithmetic
Drill #1:
https://glitch.com/edit/#!/descriptive-fragrance
Drill #2:
https://glitch.com/edit/#!/boulder-bathroom
Drill #1:
https://powerful-fir.glitch.me
Drill #2:
https://glitch.com/edit/#!/young-geese
Drill #1: https://glitch.com/edit/#!/tough-argument?path=src/components/surprise-button.js:5:44
Drill #2: https://glitch.com/edit/#!/cliff-park?path=src/components/rate-calculator.js:38:18
Drill #3: https://glitch.com/edit/#!/bumpy-writer?path=src/components/live-search.js:28:11
Drill #1: https://healthy-pantry.glitch.me
Drill #2: https://probable-scallion.glitch.me
Traffic lights:
https://jsbin.com/veyuduw/edit?js,console,output
Error: https://jsbin.com/cozivu/edit?js,output
Area:
https://jsbin.com/dudati/edit?html,js,console,output
Temp:
https://jsbin.com/giwoduw/edit?html,js,console,output
Divisible:
https://jsbin.com/kigula/edit?html,js,console,output