Skip to content

Commit

Permalink
typo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Krafalski committed Oct 1, 2021
1 parent dc01b94 commit a00c6a5
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 10 deletions.
14 changes: 12 additions & 2 deletions data-structures-&-algorithms/big-o/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,24 @@ const myAutomaticGuesser = (number, tooLow) => {
}
};


game();
```

How close is this solution to the one you used when trying it yourself? If it matched what you tried, can you think of another way?

If it isn't how you approached it, try to code your approach

## Lab: Accumulate Points on Codewars
## Lab:

### Part 1

- What is the time complexity for the previous problems we've solved in class?
- Print primes?
- Find the median?
- Disemvowel trolls?
- Your own Index Of function
- Count words?

### Part 2 Accumulate Points on Codewars

Take some time to go back and solve any problems you got stuck on
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ Write a function that prints numbers in the Fibonacci sequence up to a give limi
### Tribonacci Sequence

- [Tribonacci Sequence on Code Wars](https://www.codewars.com/kata/556deca17c58da83c00002db)

## Lab: Accumulate Points on Codewars

- [Be Concise](https://www.codewars.com/kata/5703c093022cd1aae90012c9)
- [Recursion Factorial](https://www.codewars.com/kata/5694cb0ec554589633000036)
- [Sum of a Sequence](https://www.codewars.com/kata/586f6741c66d18c22800010a)
- [Reverser](https://www.codewars.com/kata/58069e4cf3c13ef3a6000168)
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Average humans, do not add all the numbers all at once. We add two numbers toget
21 + 7 = 28
28 + 8 = 36
36 + 9 = 45
45 + 10 = 55
45 + 10 = 55
55 + no numbers left means our answer is 55
```

Expand Down Expand Up @@ -86,7 +86,7 @@ Short circuiting:

Default argument:

- `const sumNumbers = (numsArr, sum = 0)` This will set teh value of sum to 0, if sum is undefined
- `const sumNumbers = (numsArr, sum = 0)` This will set the value of sum to 0, if sum is undefined

Default argument is a newer syntax. Let's try it. The first time we call `sumNumbers`, we are only passing one argument, so the sum will be set to the default value of 0

Expand All @@ -103,7 +103,7 @@ console.log(sumNumbers(numsToSum));

5. Now we have to define a way (or rules) to decrease our complex problem (adding 10 numbers), down to the base case, having no more numbers to add.

Each time we add a number, we have to remove it from teh array, thus decreasing the array length and bringing us closer to the base case. We'll use `.shift()` to take off the number at the start of the array.
Each time we add a number, we have to remove it from the array, thus decreasing the array length and bringing us closer to the base case. We'll use `.shift()` to take off the number at the start of the array.

Thought question: could we use `.pop()` instead?

Expand Down
13 changes: 13 additions & 0 deletions data-structures-&-algorithms/intro-to-problem-solving/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,16 @@ You have
- Discuss past interviews (from any field of work you have done)
- Bring up what makes you most anxious
- How can you work on making yourself a stronger candidate?

## Homework

Watch:

[The Secret Rules of Modern Living Algorithms](https://www.youtube.com/watch?v=kiFfp-HAu64)

And answer the following questions on Canvas:

- Describe the algorithm to win the chocolate, and not the chili
- Name 2 types of sorting algorithms discussed in the video
- Name the algorithm used to help find matches for people who needed a kidney
- What animal deals with the Traveling Salesman problem in its daily life?
8 changes: 5 additions & 3 deletions data-structures-&-algorithms/oop-continued/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

### Setting intent

> Quote
Details
> As a class, determine the intent for the day
## Trivia Questions

Expand Down Expand Up @@ -38,3 +36,7 @@ Write down any questions you have about this model, what information is needed?
## Bonus

- Make a simple BlackJack game to be played in the console

## Lab: Accumulate Points on Codewars

- [Build a Car](https://www.codewars.com/kata/5832d6e2565e120ae60000bb)
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

## Inheritance

Note: we are building on top of our code we wrote yesterday.

In our world of animals, let's say there is a new kind: Mythical creature. The mythical creature will have all the properties of methods as an animal and some additional ones. We could copy our `Animal` class and paste it and add more, but what if we need to change the `greet` function? Then we would have to find every place we copy/pasted and carefully update. We are going to keep our animal as our one source of truth as a parent class.

Original Animal:
Expand Down
9 changes: 7 additions & 2 deletions data-structures-&-algorithms/oop-intro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const delete = (item) => {

The goal will be to play a simple game of Blackjack (two players, each get two cards, determine who wins)

**Note**: We will work on solving this after the second lesson on OOP and you will get more time to work on this problem during the next session
**Note**: We will continue to work on solving this after the second lesson on OOP and you will get more time to work on this problem during the next session

- Cards with a face of 2 - 10, jack, queen, king ace
- Values of cards 2-10 are same as face, jack, queen, and king are worth 10, ace starts as a value of 11, but can be changed to a value of 1
Expand All @@ -54,4 +54,9 @@ Both of these are from the book Cracking the Code Interview. Work with a partner
- Model a Jukebox
- Model a Call Center

### Extra Problem Title
## Lab: Accumulate Points on Codewars

- [Object Oriented Piracy](https://www.codewars.com/kata/54fe05c4762e2e3047000add)
- [Classy Classes](https://www.codewars.com/kata/55a144eff5124e546400005a)
- [Regular Ball Super Ball](https://www.codewars.com/kata/53f0f358b9cb376eca001079)
- [Color Ghost](https://www.codewars.com/kata/53f1015fa9fe02cbda00111a)
14 changes: 14 additions & 0 deletions data-structures-&-algorithms/oop-intro/lesson-notes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,17 @@ console.log(StringExtra.reverse("I palindrome I"));

console.log(StringExtra.description);
```

### Extreme Super Bonus

Read this code, analyze what it does then research what is `prototype` in JavaScript, how it works and what does it do?

How does it relate to this lesson on classes?

```js
String.prototype.reverse = function () {
return this.split("").reverse().join("");
};

console.log("foMO".reverse());
```

0 comments on commit a00c6a5

Please sign in to comment.