Growth Rate | Name |
---|---|
1 | Constant |
log(n) | Logarithmic |
n | Linear |
n log(n) | Linearithmic |
n^2 | Quadratic |
n^3 | Cubic |
2^n | Exponential |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Lab 01b</title> | |
<style> | |
.heading { | |
text-align: center; |
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
'use strict'; | |
const express = require('express'); | |
const cors = require('cors'); | |
const app = express(); | |
const path = require('path'); | |
const server = require('http').createServer(app); | |
const socket = require('socket.io'); | |
const io = socket(server, { | |
cors: { origin: '*' }, |
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
function insertSort(array) { | |
//creating insertion sort function | |
} |
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
function insertSort(array) { | |
//creating insertion sort function | |
} |
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
function insertSort(array) { | |
for (let item = 1; item < array.length; item++) { | |
//looping through the input list | |
} | |
} |
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
function insertSort(array) { | |
for (let item = 1; item < array.length; item++) { | |
for (let index = item; index > 0; index--) { | |
//looping through the sub-sorted array down | |
//to the first eleemnt | |
} | |
} | |
} |
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
function insertSort(array) { | |
for (let item = 1; item < array.length; item++) { | |
for (let index = item; index > 0; index--) { | |
if (array[index] < array[index - 1]) { | |
const temp = array[index]; | |
array[index] = array[index - 1]; | |
array[index - 1] = temp; | |
} | |
} | |
} |
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
function insertSort(array) { | |
for (let item = 1; item < array.length; item++) { | |
for (let index = item; index > 0; index--) { | |
if (array[index] < array[index - 1]) { | |
const temp = array[index]; | |
array[index] = array[index - 1]; | |
array[index - 1] = temp; | |
} else { | |
break; | |
} |
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
function insertSort(array) { | |
for (let item = 1; item < array.length; item++) { | |
for (let index = item; index > 0; index--) { | |
if (array[index] < array[index - 1]) { | |
const temp = array[index]; | |
array[index] = array[index - 1]; | |
array[index - 1] = temp; | |
} else { | |
break; | |
} |
OlderNewer