Please Comment, Subscribe and Click Bell🔔🔔🔔 Icon for More Updates. To learn software course from our experts please register here for online training: goo.gl/HIB0wL
Hi Srinivas, your's lecturing is simply awesome, and could you please upload videos on Asymptotic notations of Data Structures and time complexities. Thanks, Supritha
Front and rear both will move back and forth according to how deletion and insertion operation taking place. It also follows the wrap around strategy i. e if front=n(which is the length of the array) then front = 1. Same goes for rear also if we are using ststic array. you can verify it from page no. 235 of the book introduction to algorithm by coremen third edition.
Sir I have a question you said that front is fixed in front location but when I read the book name was "Data structures by -=SEYMOUR LIPSCHITZ=-" . in this book they said whenever an element is deleted from the queue the value of front is increased by 1 this can be implemented by the assignment FRONT :=Front+1; similarly when we inserted an element on array its assignment RARE :=RARE + 1; so now I am in confusion whom should I follow you or the book ? Please sir, clear it.
My teacher explains that front value is not static for all time it will increased when deleting an element from first positon. Which is crct??? In deletion algorithm we can recognise that the front value is always incrimenting after deletion
Sir I have a question you said that front is fixed in front location but when I read the book name was "Data structures by -=SEYMOUR LIPSCHITZ=-" . in this book they said whenever an element is deleted from the queue the value of front is increased by 1 this can be implemented by the assignment FRONT :=Front+1; similarly when we inserted an element on array its assignment RARE :=RARE + 1; so now I am in confusion whom should I follow you or the book ? Please sir, clear it.
sir, You are simply amazing of explaining the stringent concepts in an easy way .Thank u so much sir, we want more videos on c like quick sort algorithm
Sir I have one doubt, you said the front value remains same in entire program .. but in the text book instead of shifting the values ..they have incremented the front value...which one is correct
For correct explanation with visuals and algo, this could help As front part moves when we delete 👇 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-1F836VZ7FCI.html
Sir ... I have few confusion.... Sir you said that front is not change in deletion the elements but I learned that front value is changing when deletion
When front [0] and rear[0] there can still be one element no ? Like in the index position 0 if we fill 10 then front and rear both points to 10 how the queue is empty
how can all elements start shifting..although u are correct that we cannot delete those elements permanently as they are occupies some memory as they allocate memory in array but they are removed from queue..
what a complexity , when we shifting element rear to front , As you said we have a 5 element in queue and delete from front then all remaining element will shift to front , means every time complexity is equal to remaining element.
It is not possible to keep shifting all the elements when you delete an element. Sure you can do it for this queue containing only 5 elements, but what if the queue has 5000 elements? it would take too long and too much resource to shift 4999 elements after deleting each element
can you please tell me when moving elements one by one from left to right then 50 is still in last why?even also ove to next place where first 40 present
Oh come on you are not going to use 5000 entries bro. Whatever!Yes i get the logic behind not shifting the front bcz if we shift then the part of array behind the front will be wasted bcz it cannot be filled any,as in the queue is only the insertion is done only at rear end
We cannot delete middle values directly, to do so we have to first start deleting elements from front and till we reach the desired middle element 👇 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-1F836VZ7FCI.html This can be used.
I think what he meant was that when front and rear =0 there were elements in the queue which you have popped, whereas when rear and front = -1 that means that you have not done any operations on the queue bc the values are the same as the initialized values