diff --git a/interview/Remove Duplicates from Sorted Array.md b/interview/RemoveDuplicatesfromSortedArray.md similarity index 97% rename from interview/Remove Duplicates from Sorted Array.md rename to interview/RemoveDuplicatesfromSortedArray.md index 737c4d9..b729f99 100644 --- a/interview/Remove Duplicates from Sorted Array.md +++ b/interview/RemoveDuplicatesfromSortedArray.md @@ -1,7 +1,8 @@ # Remove Duplicates from Sorted Array -Translator:[Hi_archer][1] -Author:[labuladong][2] +Translator: [Hi_archer][1] + +Author: [labuladong][2] We know that for arrays,it is efficient to insert and delete elements at the end,with a time complexity of O(1).However, if we insert and delete elements at the middle or the beginning,it will move many data, with a time complexity of O(N). diff --git a/pictures/二分查找/binarySearch1.png b/pictures/binarySearch/binarySearch1.png similarity index 100% rename from pictures/二分查找/binarySearch1.png rename to pictures/binarySearch/binarySearch1.png diff --git a/pictures/二分查找/binarySearch2.png b/pictures/binarySearch/binarySearch2.png similarity index 100% rename from pictures/二分查找/binarySearch2.png rename to pictures/binarySearch/binarySearch2.png diff --git a/算法思维系列/BinarySearch.md b/think_like_computer/BinarySearch.md similarity index 98% rename from 算法思维系列/BinarySearch.md rename to think_like_computer/BinarySearch.md index 009ff13..55acd98 100644 --- a/算法思维系列/BinarySearch.md +++ b/think_like_computer/BinarySearch.md @@ -157,7 +157,7 @@ int left_bound(int[] nums,int target){ >A2: Before this, let's think about what's meaning of `left border` is: -![](../pictures/%E4%BA%8C%E5%88%86%E6%9F%A5%E6%89%BE/binarySearch1.png) +![](../pictures/binarySearch/binarySearch1.png) For this array, the algorithm will get result `1`. The result `1` can be interpreted this way: there is 1 element in `nums` which element is less than 2. @@ -243,7 +243,7 @@ int right_bound(int[] nums,int target){ //Thinking this way: mid = left - 1 } ``` -![](../pictures/%E4%BA%8C%E5%88%86%E6%9F%A5%E6%89%BE/binarySearch2.png) +![](../pictures/binarySearch/binarySearch2.png) When we update the value of `left`, we must do it this way: `left = mid + 1`, which means when `while` is terminated, `nums[left]` must not equal to `target`, but `nums[left-1]` could be equal to `target`. diff --git a/算法思维系列/.DS_Store b/算法思维系列/.DS_Store deleted file mode 100644 index ae719c8..0000000 Binary files a/算法思维系列/.DS_Store and /dev/null differ