Posts

If you have the Sentinel feat, can you choose not to reduce a creature's speed to zero when you hit with an...

Image
5 Assuming you have the Sentinel feat, can you choose to not reduce an opponent's speed to zero when you hit them with an opportunity attack? dnd-5e feats movement opportunity-attack share | improve this question edited 2 hours ago V2Blast 19.5k 3 54 119 asked 4 hours ago Dumpcats 3,148 2 26 55 add a comment  |  ...

Why is deletion of an item at end of Dynamic array O(n) time complexity?

Image
6 2 I am currently reading my textbook and I am totally confused why a dynamic array would require O(n) time to delete an item at the end. I understand that deleting an item from any other index is O(n) because you have to copy all the data and move them to fill in the gap, but if it’s at the end don’t we simply just decrement the count and set the index to like 0 or null? I included a picture from my book. It’s weird cause it says indexing is O(1) so we must know where the item is so we don’t have to traverse the array like a linked list. java dynamic-arrays share | improve this question asked 3 hours ago Belphegor ...