From 2666344b3612bac54f850e945da94014344782f6 Mon Sep 17 00:00:00 2001 From: Michael Sparre <67245304+micsparre@users.noreply.github.com> Date: Wed, 19 Jul 2023 04:22:22 -0700 Subject: [PATCH] contents: 2 grammar fixes for linked list doc (#596) --- apps/website/contents/algorithms/linked-list.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/website/contents/algorithms/linked-list.md b/apps/website/contents/algorithms/linked-list.md index a27de789..b5429f0e 100644 --- a/apps/website/contents/algorithms/linked-list.md +++ b/apps/website/contents/algorithms/linked-list.md @@ -96,7 +96,7 @@ Be familiar with the following routines because many linked list questions make ### Sentinel/dummy nodes -Adding a sentinel/dummy node at the head and/or tail might help to handle many edge cases where operations have to be performed at the head or the tail. The presence of dummy nodes essentially ensures that operations will never have be done on the head or the tail, thereby removing a lot of headache in writing conditional checks to dealing with null pointers. Be sure to remember to remove them at the end of the operation. +Adding a sentinel/dummy node at the head and/or tail might help to handle many edge cases where operations have to be performed at the head or the tail. The presence of dummy nodes essentially ensures that operations will never be done on the head or the tail, thereby removing a lot of headache in writing conditional checks to dealing with null pointers. Be sure to remember to remove them at the end of the operation. ### Two pointers @@ -108,7 +108,7 @@ Two pointer approaches are also common for linked lists. This approach is used f ### Using space -Many linked list problems can be easily solved by creating a new linked list and adding nodes to the new linked list with the final result. However, this takes up extra space and makes the question much less challenging. The interviewer will usually request that you modify the linked list in-place and the solve the problem without additional storage. You can borrow ideas from the [Reverse a Linked List](https://leetcode.com/problems/reverse-linked-list/) problem. +Many linked list problems can be easily solved by creating a new linked list and adding nodes to the new linked list with the final result. However, this takes up extra space and makes the question much less challenging. The interviewer will usually request that you modify the linked list in-place and solve the problem without additional storage. You can borrow ideas from the [Reverse a Linked List](https://leetcode.com/problems/reverse-linked-list/) problem. ### Elegant modification operations