From e7596b97aa96d17596ad341147868448a09f48ab Mon Sep 17 00:00:00 2001 From: Jidong Xiao Date: Thu, 14 Sep 2023 13:28:17 -0400 Subject: [PATCH] adding lecture 5 notes --- lectures/05_classes_II/README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lectures/05_classes_II/README.md diff --git a/lectures/05_classes_II/README.md b/lectures/05_classes_II/README.md new file mode 100644 index 0000000..7c52667 --- /dev/null +++ b/lectures/05_classes_II/README.md @@ -0,0 +1,19 @@ +# Lecture 5 --- Classes II: Sort, Non-member Operators + +- Classes in C++; +- Non-member operators + +## 5.1 C++ Classes + +- Nuances to remember + + - Within class scope (within the code of a member function) member variables and member functions of +that class may be accessed without providing the name of the class object. + - Within a member function, when an object of the same class type has been passed as an argument, direct +access to the private member variables of that object is allowed (using the ’.’ notation). + +## 5.2 Exercises + +- [Leetcode problem 905: Sort Array By Parity](https://leetcode.com/problems/sort-array-by-parity/). Solution: [p905_sortarraybyparity.cpp](../../leetcode/p905_sortarraybyparity.cpp) +- [Leetcode problem 977: Squares of a Sorted Array](https://leetcode.com/problems/squares-of-a-sorted-array/). Solution: [p977_sortedsquare.cpp](../../leetcode/p977_sortedsquare.cpp) +- [Leetcode problem 1051: Height Checker](https://leetcode.com/problems/height-checker/). Solution: [p1051_heightchecker.cpp](../../leetcode/p1051_heightchecker.cpp)