diff --git a/arrays_and_strings/README.md b/arrays_and_strings/README.md index b482df9..f1136de 100644 --- a/arrays_and_strings/README.md +++ b/arrays_and_strings/README.md @@ -1,5 +1,37 @@ ## arrays and strings +
+ +### comparing strings + +
+ +* "==" can be used to compare two strings only if the language support operator overloading (like C++). + +
+ +---- + +### two-pointer technique + +
+ +* a typical scenario is when you want to iterate the array from two ends to the middle. +* another secnario is when you need one slow-runner and one fast-runner at the same time (so that you can determine the movement strategy for both pointers). +* in any case, this technique is usually used when the array is sorted. + +
+ +--- + +### two-dimensional arrays + +
+ +* in some languages (like C++), 2d arrays are represented as 1d, so an array of `m * n` elements represents `array[i][j]` as `array[i * n + j]`. +* dynamic 2d arrays a nested dynamic array. + +
---