Important Note: For deleteAfter and deleteStart, if these methods had a return type of void it would be fine, however, since these methods return a reference, you should update toDelete.next to null before returning toDelete. This is because toDelete holds a reference to the entire list and we only want a reference to the single node that's being deleted.
Thank you for the comprehensive explanations. This has helped me prepare for the exam in my OOP2 class :) Edit: Please make more videos that give a thorough treatment to intermediate and advanced topics in programming. I found that videos on the topic of linked lists were quite dumbed down and didn't have the depth that I needed to flesh out my understanding. until I found your channel. The "beginner's guide" collection of programming videos seems to be quite saturated, but those are of limited utility. We need more videos like yours on youtube.
The key was to really help ace the Data Structures course. Please don't forget to share / recommend the channel to others / on social media to help it grow.
Thank you soooooooooooooooooooooooooooooooo much after months of banging my head just by animation you made me understand this. Unbelievable. Thank you again
Is it just me or this channel videos does not come out when i search it, like im looking at his video about doubly linked list and i scroll so far down, still cant see it. Its so annoying cus this video is so much better than those thats being recommended.
Hi BoostRoo. When I said "and that's how I would delete the node at the end of the list", I meant the method in general, not by the statement "return curr". Returning curr just gives us access to the node after removing it from the linked list. The deletion of the last node comes from removing the pointer that is holding that node in the list (8.next). Hope this helps :)
@@BlueTreeCode Hey, thanks for the reply! Similarly at 10:41, how is the node that toDelete is referencing deleted from the list when toDelete.next is still pointing to the node that head is referencing? Isn't it therefore still attached to the overall list and thus not deleted?
@@BoostRoo You're welcome BoostRoo. Yes, good catch! toDelete.next does have a reference to the head of the list. Although it's unreachable from the new head, it's still part of the list, so toDelete.next should be set to null to ensure manipulating that node will not mess up the actual list. I will add this edit to the description :)
@@BlueTreeCode Ok great - this was confusing me a lot! And so the toDelete node is not deleted from memory right? What if we set toDelete.next to null? Would Java delete it from memory through automatic garbage collection, or somehting? Or would it just remain in memory, essentially in limbo as it's now inaccessible?
@@BoostRoo Thank you for bringing it up! Once the referenced node being returned is assigned to another reference variable, it will not get garbage collected since another reference variable is now referencing it. The following gives you the option to keep the deleted node. Eg) Node deletedNode = deleteStart(); However, if we do not assign it to another reference variable, then it will get scheduled for garbage collection whether or not we set toDelete.next to null. This is because toDelete is a local variable (so it gets destroyed once the method finishes executing). Eg) deleteStart();
Hi Stacey Loulouse, so I think you might be referring to time complexity. It takes linear time to traverse to the end of the list. However, space complexity refers to the amount of extra space used by the algorithm. Inserting at the end uses a constant/fixed amount of space (regardless of the length of the list, only one node and some set space for variables are being created). Hope this helps :)
11:40 Is this method to delete a specified node, or to delete the node after a specified node? It seems like it's the latter, by would you do this instead of just simply specifying the node you want to delete? I'm curious why you didn't describe a method simply saying how to delete a specified node :P
Hi BoostRoo, so basically these methods are exercises to help everyone understand how to manipulate linked lists. I'm not sure why I didn't add a method to delete a specific node, but you can check out my video on "Introduction to graphs". Over there I have a method to delete a node in a LinkedList. (NB: You don't need to understand graphs) at **** 21:13 ****
thanks for the tutorial. But, I have a doubt about the space complexity of the insertion node algorithm. It was not considered extra space because it was only one node you are adding. If instead of a node was a group of nodes like an array, then the space complexity was O(n). That's the concept of extra space? thank you for the explanation.
@Luisa Pérez, you're welcome :) So, if we're thinking about space complexity, we would be considering space outside the given input array. The algorithms in this video use a constant amount of extra space, so it does use some negligible space, such as for creating variables, a node, etc, which translates to the O(1) in the video (I should have clarified that). Going back to your example, if you're given an input array with say 'n' nodes, and the memory outside your input array (used by your solution) is not directly related to size of your input array(e.g. you did not create an extra array that is 1/2 n in size), then you have a constant space algorithm. If ,however, in your question, you decide create an array with say 1/2 the size of n every time your algorithm runs, then you'd have a linear space algorithm on your hands, as 1/2 n translates to O(n) space complexity. Hope this helps :)
Hi Johnpaul, for a university course you should be expected to build data structures from scratch. If you're applying for a tech job, you may be required to build these from scratch as well, so it's good to be knowledgeable on this. However, when writing software, It's extremely rare I would be building a data structure from scratch. I would simply import the specific DS since the Big O would be identical to a custom implementation.
Hi Thanos, sure! This is the linked list we're given. curr | 4 | ---> | 12 | ---> null This is the node we want to insert. n | 8 | Think of it this way: Nodes = Blocks Floating above the ocean. References between Nodes = Ropes with hooks on the end that keep blocks attached to each other. Named References ( head , curr , n ) = Ropes with hooks on the end, except they have anchors that keep them from floating away. If just one hook is pulled out, the blocks attached to it will drift away with the ocean's current. e.g) If the 'head' or anchor is pulled out from 4, then 4 and 12 will still be attached to each other, but they will drift away at sea. How can we attach our block with anchor 'n' between our blocks 4 and 12 without any blocks drifting away? Well, if we set curr.next ( rope between 4 and 12 ) to n's block ( 8 ), then 12 will float away because we're removing the hook holding on to 12 in order to attach it to n. Instead, we know 'n' is an anchor holding on to block 8, and n.next is a rope with a hook extending from block 8. n n.next | 8 |-------------------> curr.next | 4 |-------------------> | 12 | If we have "n.next" hook on to 12 ( remember the only way to get 12 is through the rope "curr.next"), 12 will not drift away because our "n" is anchoring 8. So let's do that by: n.next = curr.next n n.next | 8 |----------------------\ \ n.next curr.next \ | 4 |-----------------------------------------------| 12 | Now, if we remove our rope "curr.next" that is hooking on to 12, then it's ok, because, n is anchoring 8 and 8 is connected to 12, so 12 will not float away. So let's do that by saying: curr.next = n n n.next | 8 |------------------- / \ curr.next / \ n.next / \ | 4 | | 12 | And that's basically it. Hope this helps :)
@@BlueTreeCode beautiful Small suggestion Why are you not using memory also Instead of next we can use random memory also. For ex : for memory box 1 , reference is 100 For memory box 2 , reference is 104 It will be easy to understand.
@@thanos9704 Hi Thanos, sure you can use numbers as memory addresses as a way of understanding how memory works. However, when it comes to writing out algorithms, 'next' is often used with Linked Lists, just as 'root', 'left' and 'right' are used Binary Trees. If you do take a class in C, however, you will definitely need to understand memory, as it isn't garbage collected like in Java. You will need to manually allocate and free memory.
Hey There! When I said 'data I want to remove', I meant to say 'data' I want to remove after. :) That's a wording mistake. 'data' is the data we want to remove after (in this case the data we want to remove after is 4, so we call deleteAfter(4)). Hope this cleared it up for you.
Thanks for the great explanation. for the method deleteLast(); also after while(){} you should to invoke method deleteFirst() in case if we have one node // 6- deleteLast public void deleteLastNode() { if(isEmpty()) { System.out.println("List is Empty"); return; } Node curr = head; Node nextNode = curr.next;
Hi Ninoos. You're very welcome. So, the single node is taken care of in the conditional => if (curr == null || curr.next == null). In this conditional we set the head to null if there's a single node thereby removing it from the list.
hi how do i can write a function that moves the linked list to the right k (variable) times? i.g: the linked list is : [ 1,2,3,4,5 ] and k=3 so the function returns [ 5,4,1,2,3 ] hope for a help
Hi Tyrique, So in Java, once a node no longer a reference to it (or there's nothing pointing to it), it's automatically garbage collected and destroyed. This frees up memory that is no longer being used. Hope this helps :).
For the AddAfter method, why curr = curr.next while curr is null? Is that mean if the curr is null, we switch curr into curr.next? but why? (sorry for the stupid question)
@Alex Yip, No question is stupid, my friend! That's how you learn. So let's go over the method. First, we check if curr, which pointing to the head of the list is null (simply as an error check) in the case that the Linked List is empty. And, well, if it's empty (null), that's great, because we have nothing to do, because we know that there's no data for us to insert after (therefore we never enter the while loop). However, if head is not null, then we definitely need to traverse the list to check if the node with that data (insertAfter) is in the list, so that we can insert after that node. In this case, we keep moving curr to the next node until we either reach the end of the list and find out the node we want to insert after is not there, or we find out that the node we want to insert after is there, and we insert our node. Hope this helps! :)
For the Add Node After challenge I did this, would it work? Because it's a bit different from yours: void InsertAfter(int after, int data){ Node current = head; if (current != null){ while (current.data != after){ current = current.next; } Node n = new Node(data); current.next = n; } }
Hi, Floruz. I'm glad you tried it, that's how you get better! So, the first thing that hits me is when the data is not in the list. When your loop gets to the last node and it sees that current.data is not equal to after, it will set current to its next (which is null). However, the loop doesn't stop, and then proceeds to check if current.data != after, and well, current is null so there can't be an after. Hope this helps :)
i did this and its working for me but my problem is i have a 2d array linked list and im trying to delete tend of a column/row. and this is killing me lol
Hi, Dang Le. If you meant a Linked List with each Node being a 2D array, then once you reach the node you want to remove data from, you can use a nested loop approach (if the data is not sorted) on the 2D array to search for and remove the element you're trying to delete by setting its value to Null (If you're dealing with a reference type). If you're dealing with a primitive type like an 'int' for example, you can set the value to an integer that would represent a false value for your particular problem (e.g. -1 or 0). If the data in the 2d array is sorted, you can most likely search for the data in (m+n) time instead of m*n, where m would be the # of rows and n would be the # of columns. Hope this helps :)
Important Note: For deleteAfter and deleteStart, if these methods had a return type of void it would be fine, however, since these methods return a reference, you should update toDelete.next to null before returning toDelete. This is because toDelete holds a reference to the entire list and we only want a reference to the single node that's being deleted.
I’m going to recommend anyone confused about linkedlists to this video! Hands down the best one on TH-cam. Thanks!!!
Thank you so much, marhawk!
Wow that's amazing in just 15 min I have learnt 6 types of insertion and deletion at glance .
Thanks for this nice content.
Glad to hear, Rahul! :)
Your video is truly the best one in entire TH-cam to learn data structures in java
Thank you, Rajesh Samson! :)
Thank you for the comprehensive explanations. This has helped me prepare for the exam in my OOP2 class :)
Edit: Please make more videos that give a thorough treatment to intermediate and advanced topics in programming. I found that videos on the topic of linked lists were quite dumbed down and didn't have the depth that I needed to flesh out my understanding. until I found your channel. The "beginner's guide" collection of programming videos seems to be quite saturated, but those are of limited utility. We need more videos like yours on youtube.
The key was to really help ace the Data Structures course. Please don't forget to share / recommend the channel to others / on social media to help it grow.
OMG!!! Man that visual representation made everything crystal clear love u man.
Thank you so much!!! Please don't forget to share the channel with others as it will help it to grow.
This cleared the whole concept up for me. Thanks for providing with simple explanations and great visuals, subscribed!
Thanks, Keenal Shah! Glad it helped :)
That's the best video about Linked lists, EXTREMELY HELPFUL
Thank you so much BTC
Thank you so much! I'm glad you found it helpful! Don't forget to share the channel with others.
Best video ever! Been struggling with linked list for a while and this just brought the pint home!
Glad you found it helpful!! Please don't forget to share / recommend the channel on social media to help it grow.
You are the best. You left no stone unturned.
Thank you👍👍
Thank you so much! Please don't forget to like and share as it will help the channel grow.
Best one on youtube i hope u continue
you are the legend of the explanation
Thank you so much! Please don't forget to like and share as it will help the channel to grow.
Very nice presentation
The best explanation of linked list I have ever seen.
Thanks! I try my best :)
These are some amazing and concise videos that really help visualize these concepts and algorithms. Thank you so much! Subscribed!
Thank you so much!! Please don't forget to share the videos as it helps the channel grow.
Thanks for clearing time complexity for different cases (front end and after)
Glad it's helped, Mrunalini Dudhagawali.
Explained very well, thank you so much!
You're very welcome, uni!
Amazing explanation. I'm now confident in this. Thanks
Glad you're confident! Please don't forget to share / recommend the channel on social media to help it grow.
you just saved me from 1 week of 3 hour sleep
Thank you
You're very welcome, Eric! :)
Hats off , excellent animations and explanation.
Thanks, Anis!
This was a really good explanation with good diagrams! Helped me understand the concept completely! thanksss
Thank you so much!! Please don't forget to like and share the video on social media as it will help the channel grow.
This is PHENOMENALLY helpful, thank you so much!!!
😭😭😭
So glad it's helpful, M Till!
Thanks a lot Blue Tree Code , you make very clear for a me , because i am at learning stage , thanks a lot
I'm glad you've learnt a lot. Please don't forget to like and share the videos/channel to help it grow.
Thank you soooooooooooooooooooooooooooooooo much after months of banging my head just by animation you made me understand this. Unbelievable. Thank you again
I'm very happy that it's helped you immensely, Muhammad Ali. :)
Excellent explanation , Thank you
I'm glad it helped, G K Facts! :)
It was very precise and helpful. Thank you. Keep up the good work.
Glad it helped, avineet! :)
Really very very clear and helping me much get those concepts
You're very welcome, sruthi m!
Is it just me or this channel videos does not come out when i search it, like im looking at his video about doubly linked list and i scroll so far down, still cant see it. Its so annoying cus this video is so much better than those thats being recommended.
Thanks a lot! Not sure why that's happening, but what you can do is like and share the content if you found it useful.
Bro you saved my bacon! Thank you so much for the tutorial!
Thanks for the kind comment, Night Stalker! :D
You are a god bro you Help in a big problem thank you bro😊
Thank you so much!! Please don't forget to share / recommend the channel on social media to help it grow.
9:53 Why does returning curr mean the node curr is referencing gets deleted from the chain?
Hi BoostRoo. When I said "and that's how I would delete the node at the end of the list", I meant the method in general, not by the statement "return curr". Returning curr just gives us access to the node after removing it from the linked list. The deletion of the last node comes from removing the pointer that is holding that node in the list (8.next). Hope this helps :)
@@BlueTreeCode Hey, thanks for the reply! Similarly at 10:41, how is the node that toDelete is referencing deleted from the list when toDelete.next is still pointing to the node that head is referencing? Isn't it therefore still attached to the overall list and thus not deleted?
@@BoostRoo You're welcome BoostRoo. Yes, good catch! toDelete.next does have a reference to the head of the list. Although it's unreachable from the new head, it's still part of the list, so toDelete.next should be set to null to ensure manipulating that node will not mess up the actual list.
I will add this edit to the description :)
@@BlueTreeCode Ok great - this was confusing me a lot! And so the toDelete node is not deleted from memory right? What if we set toDelete.next to null? Would Java delete it from memory through automatic garbage collection, or somehting? Or would it just remain in memory, essentially in limbo as it's now inaccessible?
@@BoostRoo Thank you for bringing it up! Once the referenced node being returned is assigned to another reference variable, it will not get garbage collected since another reference variable is now referencing it. The following gives you the option to keep the deleted node.
Eg) Node deletedNode = deleteStart();
However, if we do not assign it to another reference variable, then it will get scheduled for garbage collection whether or not we set toDelete.next to null. This is because toDelete is a local variable (so it gets destroyed once the method finishes executing).
Eg) deleteStart();
YOU ARE A LIFE&TIME SAVER!
Thanks a lot!! Don't forget to like and share the channel on social media as it will help it grow.
Great video keep going
Thank you, Harshil!
subscribed , I dont wanna miss your videos :) , please keep up with more videos , cheers mate :)
Thank you!
Superb explaination
Thank you @sruthi!
Great explanations thank you.
Thank you so much. Please don't forget to like and share the channel on social media to help it grow.
how is inserting a node at the end a constant space complexity if you have to traverse the node to get there? 13:25
Hi Stacey Loulouse, so I think you might be referring to time complexity. It takes linear time to traverse to the end of the list. However, space complexity refers to the amount of extra space used by the algorithm. Inserting at the end uses a constant/fixed amount of space (regardless of the length of the list, only one node and some set space for variables are being created). Hope this helps :)
Hey Everyone! Thanks for checking out my video! Don't forget to Like, Subscribe, and MOST IMPORTANTLY click that Notification Bell for updates! :)
This was great, thank you so much!
Thank you!! Please don't forget to like and share as it will help the channel grow.
This was really helpful 👏.thanks man😊
I'm glad it helped, Haile! :)
Thank you for clearing this up
You're welcome, Tyrique! :)
that was very helpful! thank you
Glad you found it helpful! Don't forget to like and share as it will help out the channel.
11:40 Is this method to delete a specified node, or to delete the node after a specified node? It seems like it's the latter, by would you do this instead of just simply specifying the node you want to delete? I'm curious why you didn't describe a method simply saying how to delete a specified node :P
Hi BoostRoo, so basically these methods are exercises to help everyone understand how to manipulate linked lists. I'm not sure why I didn't add a method to delete a specific node, but you can check out my video on "Introduction to graphs". Over there I have a method to delete a node in a LinkedList. (NB: You don't need to understand graphs) at **** 21:13 ****
@@BlueTreeCode Cool, thanks :)
Please do more videos we will be grateful to watch
Thank you! I will try to push out some more videos, sruthi m.
Beautiful video for sure... sadly I have to watch it multiple times to fully understand it .....
thanks for the tutorial. But, I have a doubt about the space complexity of the insertion node algorithm. It was not considered extra space because it was only one node you are adding. If instead of a node was a group of nodes like an array, then the space complexity was O(n). That's the concept of extra space? thank you for the explanation.
@Luisa Pérez, you're welcome :) So, if we're thinking about space complexity, we would be considering space outside the given input array. The algorithms in this video use a constant amount of extra space, so it does use some negligible space, such as for creating variables, a node, etc, which translates to the O(1) in the video (I should have clarified that). Going back to your example, if you're given an input array with say 'n' nodes, and the memory outside your input array (used by your solution) is not directly related to size of your input array(e.g. you did not create an extra array that is 1/2 n in size), then you have a constant space algorithm. If ,however, in your question, you decide create an array with say 1/2 the size of n every time your algorithm runs, then you'd have a linear space algorithm on your hands, as 1/2 n translates to O(n) space complexity. Hope this helps :)
@@BlueTreeCode thank you. I understand better now.
this is awesome video but i still confusing if what is better in data structure hard coding or using a import ?
Hi Johnpaul, for a university course you should be expected to build data structures from scratch. If you're applying for a tech job, you may be required to build these from scratch as well, so it's good to be knowledgeable on this.
However, when writing software, It's extremely rare I would be building a data structure from scratch. I would simply import the specific DS since the Big O would be identical to a custom implementation.
Please upload more videos its really help a lot
Hi
At 7:21
can you please explain to me
1) n.next=curr.next;
2) curr.next=n;
and
3) curr = curr.next;
in detail .
I'm stuck at these 3 statements ??
Hi Thanos, sure!
This is the linked list we're given.
curr
| 4 | ---> | 12 | ---> null
This is the node we want to insert.
n
| 8 |
Think of it this way:
Nodes = Blocks Floating above the ocean.
References between Nodes = Ropes with hooks on the end that keep blocks attached to each other.
Named References ( head , curr , n ) = Ropes with hooks on the end, except they have anchors that keep them from floating away.
If just one hook is pulled out, the blocks attached to it will drift away with the ocean's current.
e.g) If the 'head' or anchor is pulled out from 4, then 4 and 12 will still be attached to each other, but they will drift away at sea.
How can we attach our block with anchor 'n' between our blocks 4 and 12 without any blocks drifting away?
Well, if we set curr.next ( rope between 4 and 12 ) to n's block ( 8 ), then 12 will float away because we're removing the hook holding on to 12 in order to attach it to n.
Instead, we know 'n' is an anchor holding on to block 8, and n.next is a rope with a hook extending from block 8.
n n.next
| 8 |------------------->
curr.next
| 4 |-------------------> | 12 |
If we have "n.next" hook on to 12 ( remember the only way to get 12 is through the rope "curr.next"), 12 will not drift away because our "n" is anchoring 8. So let's do that by:
n.next = curr.next
n n.next
| 8 |----------------------\
\ n.next
curr.next \
| 4 |-----------------------------------------------| 12 |
Now, if we remove our rope "curr.next" that is hooking on to 12, then it's ok, because, n is anchoring 8 and 8 is connected to 12, so 12 will not float away.
So let's do that by saying:
curr.next = n
n n.next
| 8 |-------------------
/ \
curr.next / \ n.next
/ \
| 4 | | 12 |
And that's basically it.
Hope this helps :)
@@BlueTreeCode beautiful
Small suggestion
Why are you not using memory also
Instead of next we can use random memory also.
For ex : for memory box 1 , reference is 100
For memory box 2 , reference is 104
It will be easy to understand.
@@thanos9704 Hi Thanos, sure you can use numbers as memory addresses as a way of understanding how memory works. However, when it comes to writing out algorithms, 'next' is often used with Linked Lists, just as 'root', 'left' and 'right' are used Binary Trees. If you do take a class in C, however, you will definitely need to understand memory, as it isn't garbage collected like in Java. You will need to manually allocate and free memory.
2024 here and the video is the fckng greatest explanation
Good explanation....
Thank you, Leena!
@11:34 how can curr.data == data, because data is the data to be deleted
Hey There! When I said 'data I want to remove', I meant to say 'data' I want to remove after. :) That's a wording mistake. 'data' is the data we want to remove after (in this case the data we want to remove after is 4, so we call deleteAfter(4)). Hope this cleared it up for you.
Thanks for the great explanation.
for the method deleteLast(); also after while(){} you should to invoke method deleteFirst() in case if we have one node
// 6- deleteLast
public void deleteLastNode() {
if(isEmpty()) {
System.out.println("List is Empty");
return;
}
Node curr = head;
Node nextNode = curr.next;
while(curr.next != null) {
if(nextNode.next == null) {
curr.next = null;
size--;
}
curr = nextNode;
nextNode = nextNode.next;
}
deleteFirstNode();
}
Hi Ninoos. You're very welcome. So, the single node is taken care of in the conditional => if (curr == null || curr.next == null). In this conditional we set the head to null if there's a single node thereby removing it from the list.
So I used this code to then create a linked list but how do I call these functions to addtoend??
hi
how do i can write a function that moves the linked list to the right k (variable) times? i.g: the linked list is : [ 1,2,3,4,5 ] and k=3 so the function returns [ 5,4,1,2,3 ]
hope for a help
each code work in php in this video thanx u
I'm not familiar with php, but the logic should the same. Syntax, most likely not.
love ur videos !
Thanks! Don't forget to like and share.
How does delete node after actually delete the node?
Hi Tyrique, So in Java, once a node no longer a reference to it (or there's nothing pointing to it), it's automatically garbage collected and destroyed. This frees up memory that is no longer being used. Hope this helps :).
For the AddAfter method, why curr = curr.next while curr is null? Is that mean if the curr is null, we switch curr into curr.next? but why? (sorry for the stupid question)
@Alex Yip, No question is stupid, my friend! That's how you learn. So let's go over the method. First, we check if curr, which pointing to the head of the list is null (simply as an error check) in the case that the Linked List is empty. And, well, if it's empty (null), that's great, because we have nothing to do, because we know that there's no data for us to insert after (therefore we never enter the while loop). However, if head is not null, then we definitely need to traverse the list to check if the node with that data (insertAfter) is in the list, so that we can insert after that node. In this case, we keep moving curr to the next node until we either reach the end of the list and find out the node we want to insert after is not there, or we find out that the node we want to insert after is there, and we insert our node. Hope this helps! :)
@@BlueTreeCode Bro, you better my professor 10000 times
For the Add Node After challenge I did this, would it work? Because it's a bit different from yours:
void InsertAfter(int after, int data){
Node current = head;
if (current != null){
while (current.data != after){
current = current.next;
}
Node n = new Node(data);
current.next = n;
}
}
Hi, Floruz. I'm glad you tried it, that's how you get better! So, the first thing that hits me is when the data is not in the list. When your loop gets to the last node and it sees that current.data is not equal to after, it will set current to its next (which is null). However, the loop doesn't stop, and then proceeds to check if current.data != after, and well, current is null so there can't be an after. Hope this helps :)
@@BlueTreeCode Thank you!
thank you so much
You're welcome, fatemeh strong :)
i did this and its working for me but my problem is i have a 2d array linked list and im trying to delete tend of a column/row. and this is killing me lol
Hi, Dang Le. If you meant a Linked List with each Node being a 2D array, then once you reach the node you want to remove data from, you can use a nested loop approach (if the data is not sorted) on the 2D array to search for and remove the element you're trying to delete by setting its value to Null (If you're dealing with a reference type). If you're dealing with a primitive type like an 'int' for example, you can set the value to an integer that would represent a false value for your particular problem (e.g. -1 or 0). If the data in the 2d array is sorted, you can most likely search for the data in (m+n) time instead of m*n, where m would be the # of rows and n would be the # of columns. Hope this helps :)
thank you
You're welcome, Ninja Cat!
Finally a video with not an Indian accent xD