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
Now that you have learned the basics of Git workflow, try running through this a couple of times on your own: | |
Create a folder called learn_git_again. mkdir learn_git_again | |
cd into the learn_git_again folder.cd learn_git_again | |
Create a file called third.txt. touch third.txt | |
Initialize an empty git repository. git init | |
Add third.txt to the staging area.git add third.txt | |
Commit with the message "adding third.txt".git commit -m "adding third.txt" | |
Check out your commit with git log.git log | |
Create another file called fourth.txt.touch fourth.txt |
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
Now that you have learned the basics of Git workflow, try running through this a couple of times on your own: | |
Create a folder called learn_git_again. mkdir learn_git_again | |
cd into the learn_git_again folder.cd learn_git_again | |
Create a file called third.txt. touch third.txt | |
Initialize an empty git repository. git init | |
Add third.txt to the staging area.git add third.txt | |
Commit with the message "adding third.txt".git commit -m "adding third.txt" | |
Check out your commit with git log.git log | |
Create another file called fourth.txt.touch fourth.txt |
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
Now that you have learned the basics of Git workflow, try running through this a couple of times on your own: | |
Create a folder called learn_git_again. mkdir learn_git_again | |
cd into the learn_git_again folder.cd learn_git_again | |
Create a file called third.txt. touch third.txt | |
Initialize an empty git repository. git init | |
Add third.txt to the staging area.git add third.txt | |
Commit with the message "adding third.txt".git commit -m "adding third.txt" | |
Check out your commit with git log.git log | |
Create another file called fourth.txt.touch fourth.txt |
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 binarySearch(numberArray, key){ | |
var firstIndex = 0; | |
var lastIndex = numberArray.length - 1; | |
while (firstIndex <= lastIndex){ | |
// Find the mid index | |
var middleIndex = Math.floor((firstIndex + lastIndex) / 2); | |
var middleElement = numberArray[middleIndex]; |
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
// Pseudocode | |
- As always we'll start by defining our function which takes an array as a parameter - as reviewed in the logic above: function bubbleSort(array){}; | |
- Model the parent loop to iterate upto n-1 limits | |
- Model the inner loop to deduct each pass from the already set limit of the parent loop | |
- As we loop through the array we are going to be comparing and switching our array elements - when necessary, that is, until our largest number bubbles up to the top/end. | |
- With the two loops in place, we now need to build out the code to compare and switch neighbouring numbers - if necessary. | |
// Code |