From 0cd3198d05006a1383ecc8233b30f1a60c0c4938 Mon Sep 17 00:00:00 2001
From: marina <138340846+bt3gl-cryptography@users.noreply.github.com>
Date: Mon, 31 Jul 2023 18:20:46 -0700
Subject: [PATCH] add note on 2d arrays
---
arrays_and_strings/README.md | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
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.
+
+
---