We hope you all are enjoying our videos!!! Don't forget to leave a comment!!! Please like the video to support us!!! Questions you might like: ✅✅✅[ Tree Data Structure ] : ua-cam.com/play/PLJtzaiEpVo2zx-rCqLMmcFEpZw1UpGWls.html ✅✅✅[ Graphs Data Structure ] : ua-cam.com/play/PLJtzaiEpVo2xg89cZzZCHqX03a1Vb6w7C.html ✅✅✅[ January Leetcoding Challenge ] : ua-cam.com/play/PLJtzaiEpVo2wCalBcRcNjXQ0C6ku3dRkn.html ✅✅✅[ December Leetcoding Challenge ] : ua-cam.com/play/PLJtzaiEpVo2xo8OdPZxrpybGR8FmzZpCA.html ✅✅✅[ November Leetcoding Challenge ] : ua-cam.com/play/PLJtzaiEpVo2yMYz5RPH6pfB0wNnwWsK7e.html ✅✅✅[ August Leetcoding Challenge ] : ua-cam.com/play/PLJtzaiEpVo2xu4h0gYQzvOMboclK_pZMe.html ✅✅✅July Leetcoding challenges: ua-cam.com/play/PLJtzaiEpVo2wrUwkvexbC-vbUqVIy7qC-.html ✅✅✅June Leetcoding challenges: ua-cam.com/play/PLJtzaiEpVo2xIfpptnCvUtKrUcod2zAKG.html ✅✅✅May Leetcoding challenges: ua-cam.com/play/PLJtzaiEpVo2wRmUCq96zsUwOVD6p66K9e.html ✅✅✅Cracking the Coding Interview - Unique String: ua-cam.com/play/PLJtzaiEpVo2xXf4LZb3y_BopOnLC1L4mE.html Struggling in a question?? Leave in a comment and we will make a video!!!🙂🙂🙂
when the index reached the last index suppose the length of the array is 6 and the rear or front index is 5. Now when I add 1 more element we need to move the rear to index 6 which is not possible so the new index becomes 6mod6 which is 0. we are using mod because the queue is circular and the last index is connected to 0 indexes. hope that clarifies things for you.
We hope you all are enjoying our videos!!! Don't forget to leave a comment!!! Please like the video to support us!!!
Questions you might like:
✅✅✅[ Tree Data Structure ] : ua-cam.com/play/PLJtzaiEpVo2zx-rCqLMmcFEpZw1UpGWls.html
✅✅✅[ Graphs Data Structure ] : ua-cam.com/play/PLJtzaiEpVo2xg89cZzZCHqX03a1Vb6w7C.html
✅✅✅[ January Leetcoding Challenge ] : ua-cam.com/play/PLJtzaiEpVo2wCalBcRcNjXQ0C6ku3dRkn.html
✅✅✅[ December Leetcoding Challenge ] : ua-cam.com/play/PLJtzaiEpVo2xo8OdPZxrpybGR8FmzZpCA.html
✅✅✅[ November Leetcoding Challenge ] : ua-cam.com/play/PLJtzaiEpVo2yMYz5RPH6pfB0wNnwWsK7e.html
✅✅✅[ August Leetcoding Challenge ] : ua-cam.com/play/PLJtzaiEpVo2xu4h0gYQzvOMboclK_pZMe.html
✅✅✅July Leetcoding challenges: ua-cam.com/play/PLJtzaiEpVo2wrUwkvexbC-vbUqVIy7qC-.html
✅✅✅June Leetcoding challenges: ua-cam.com/play/PLJtzaiEpVo2xIfpptnCvUtKrUcod2zAKG.html
✅✅✅May Leetcoding challenges: ua-cam.com/play/PLJtzaiEpVo2wRmUCq96zsUwOVD6p66K9e.html
✅✅✅Cracking the Coding Interview - Unique String: ua-cam.com/play/PLJtzaiEpVo2xXf4LZb3y_BopOnLC1L4mE.html
Struggling in a question??
Leave in a comment and we will make a video!!!🙂🙂🙂
We can also initialize rear with -1 in that case we might not need to handle special case where check Is made for the empty part, WDYT?
Thank youuuuuu
my pleasure
Consistency = algorithms made easy
can someone help me understand why a list over a linked list?
Very nicely explained
Could you explain the mod line a little more?
rear = rear % q.length
front = front % q.length
when the index reached the last index suppose the length of the array is 6 and the rear or front index is 5.
Now when I add 1 more element we need to move the rear to index 6 which is not possible so the new index becomes 6mod6 which is 0. we are using mod because the queue is circular and the last index is connected to 0 indexes.
hope that clarifies things for you.
@@AlgorithmsMadeEasy That makes so much sense. It just clicked. Thank you for the video.
@@AlgorithmsMadeEasy thax man! for explanation
agar comment maa aa k nhi dkeha hot to sir k upar se chala gaya tha.
well explained
thank you!
thank you for wonderfull explanation
you didnt explained the main thing for which many of us were here "%"!