ArrayDeque vs LinkedList Implementation: -In Deque a small number of insertions run in Θ(n) time by doubling the array capacity and copying elements over. -Accesse time -dynamic arrays are usually faster than linked lists. -Memory - Linked list usually take O(n) total extra memory due to the storage of an extra pointer in each element. -Worst CAselinked list versions have better worst-case behavior Conclusion: If per operation time is not important, Deque implementation is better
If you need efficient random access or require frequent modifications at both ends of the queue, ArrayDeque is a better choice. On the other hand, if fast insertion and removal at the beginning or end of the queue are the main concerns, LinkedList can be a suitable option.
The removal of the elements from the queue can be done in O(1) by just incrementing the front pointer and when it reaches to rear make front and rear -1 It will never take O(n) to peek and remove from the queue.
Just one word 'Thankyou' Thank you for each and everything you guys are doing for us 😊 I'm in first year and I cannot describe how beneficial the videos are for me. Thank you Shraddha didi, Aman Bhaiya & team for the efforts ❤️
Mam please make more videos on java placement course I am a third year undergrad student currently in 6th sem companies will be arriving in next 6 months and continously following these placement course series in java. Requesting @Apna College to upload videos regularly waiting since over a week for next upcoming videos.
Shradha, You explained the queue concept in so easy manner.Thank you so much. Would you please explain how the complexity of peek method is O(n)? As far as I think it should be O(1) as we are just printing the 0th element of the array.
I really liked your teaching style and it is excellent! However, in this Queue Implementation, a few things need to modify. 1. We should not use the static method while creating Data structures like Stack, array, LinkedList, and queue because we should use static for utility classes in order to check like-string to upper-class and lower-class, etc. 2. In this queue data structure, we need to store some value that is the purpose. 3 .When to use the static class: Static should use when you give some input and act on that and return something. It never persists in anything. in your program, you used the static class Queue-it should Non-static Queue class. Overall, I really enjoyed your every video. you are doing a really great job. Keep it up!!!
plzz maam make video on binary tree , heapmap, graph also ur teaching way is awesome very easy to understand... I m from electrical background and watch every video if I know coding it all because of u .... u r great mentor
Hi Team , so basically content is too much good and guys are also lovely one thing i would like to inform you that during teaching the concept you speed should be little bit slow then we can understand better with good mindset your every video too much helpful , needful for us. Thanks a lot to you guys for creating such a nice content. A lot of love from my side. :)
congratulations aman bhaiya shardha didi and all the members of apna college family aaj hamri family 1 million ki ho gyi. ye ham sabhi kabhi glorious moment hai
ma'am, tbh u r just an angel for me thanks for the teaching. A most understanding and a teacher with all behaviors of a student just a complete package. Thanks a lot.
arraydequeue is faster than linked list but when it comes on time sensitive applications we use linked list, because of its cache and operation time taking
difference between arraydeque and linked list The general-purpose implementations include LinkedList and ArrayDeque classes. The Deque interface supports insertion, removal and retrieval of elements at both ends. The ArrayDeque class is the resizeable array implementation of the Deque interface, whereas the LinkedList class is the list implementation. The basic insertion, removal and retrieval operations in the Deque interface addFirst, addLast, removeFirst, removeLast, getFirst and getLast. The method addFirst adds an element at the head whereas addLast adds an element at the tail of the Deque instance. The LinkedList implementation is more flexible than the ArrayDeque implementation. LinkedList implements all optional list operations. null elements are allowed in the LinkedList implementation but not in the ArrayDeque implementation. In terms of efficiency, ArrayDeque is more efficient than the LinkedList for add and remove operation at both ends. The best operation in a LinkedList implementation is removing the current element during the iteration. LinkedList implementations are not ideal structures to iterate. The LinkedList implementation consumes more memory than the ArrayDeque implementation.
1. Why do you define the add, remove and peek methods as static? They should be instance methods and, therefore, not static 2. Why do you define the static class queue? Skip it and write its code as the body of the Queue class In addition, I suggest implementing the internal linked List using a sentinel head node. The sentinel does not contain valid data, only zero. This simplifies the implementation of the various methods.
Ab aap videos upload kroge ya nhi atleast itna bta do.... Taaki hm khi or se pdh le..... Aap pr depend na rhe...... Please.......hmm aapki videos ka intzar kr rhe h
Api Kia ap distribute database system k lecture day Sakti Hy ap mashallah Bhat Acha c lecture dati Hy Allah ap ko Zindagi ma Bhat kamyab kry or homes Kashi Rakh ap ki team ko bi
Maybe in long term this wi fetch you guys more views and good for the channel. But, we, who are subscribing today and making the channel big don't get to enjoy the perks of this channel. This course was started in my 6th, and my 7th sem is about to end. Such inconsistentcy.
Hi shrada ,please upload competitive coding with DP.As a python and c++ coder I never learned java that seriously but your courses are very helpful to relearn things.
Thanks a lot, we appreciate your efforts, but kindly continue uploading ahead so that we can be consistent in our learning, please help us complete this course that we have started!
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.
Remove operation takes O(n) time in array implementation makes sense but why would peek operation take O(n) time? It will have O(1) constant access time right?
Good explanation, just a quick question: On geeks for geeks, it's shown that the time complexity of array with queue during the usage of remove and peek functions is O(1) whereas in your video it is shown as O(n). Can you please clear this doubt? Thank you!
Mam I am studying degree 2nd year we learning data structure in that queue topic is there.thank u I am understood very well your class.I don't know hindi very well .... But your explanation superb and easily understand :)
Hi Shradha, love your videos but below classes also implement queue interface- AbstractQueue, ArrayBlockingQueue, ArrayDeque, ConcurrentLinkedDeque, ConcurrentLinkedQueue, DelayQueue, LinkedBlockingDeque, LinkedBlockingQueue, LinkedList, LinkedTransferQueue, PriorityBlockingQueue, PriorityQueue, SynchronousQueue why you didnt involve all?Any specific resaon
Please complete the series we are waiting. If you really want to helps us then please complete this java series we are getting disappointed the delay you are doing. Please complete it.
When I executed the program with Queue q= new ArrayDeque(); And, Queue q= new LinkedList(); It shows "The type Queue is not generic;" How to solve this?
ArrayDeque vs LinkedList Implementation:
-In Deque a small number of insertions run in Θ(n) time by doubling the array capacity and copying elements over.
-Accesse time -dynamic arrays are usually faster than linked lists.
-Memory - Linked list usually take O(n) total extra memory due to the storage of an extra pointer in each element.
-Worst CAselinked list versions have better worst-case behavior
Conclusion: If per operation time is not important, Deque implementation is better
If you need efficient random access or require frequent modifications at both ends of the queue, ArrayDeque is a better choice. On the other hand, if fast insertion and removal at the beginning or end of the queue are the main concerns, LinkedList can be a suitable option.
AA S
13:55 time complexity of peek operation in queue is o(1). btw the lecture was greatt.
The removal of the elements from the queue can be done in O(1) by just incrementing the front pointer and when it reaches to rear make front and rear -1
It will never take O(n) to peek and remove from the queue.
that's what i was thinking, peek will only take O(1)
Just one word 'Thankyou'
Thank you for each and everything you guys are doing for us 😊
I'm in first year and I cannot describe how beneficial the videos are for me. Thank you Shraddha didi, Aman Bhaiya & team for the efforts ❤️
Konse clg se h bhay
Mam please make more videos on java placement course I am a third year undergrad student currently in 6th sem companies will be arriving in next 6 months and continously following these placement course series in java.
Requesting @Apna College to upload videos regularly waiting since over a week for next upcoming videos.
+1
+1
Yes please upload videos in daily basis mam
+1
+1
Shradha,
You explained the queue concept in so easy manner.Thank you so much.
Would you please explain how the complexity of peek method is O(n)?
As far as I think it should be O(1) as we are just printing the 0th element of the array.
ya, i also think that
That is peek + remove function i.e both combined function complexity is O (n). Hope it is clear
@@codersdock2374 Thank you
@@codersdock2374 but we dont have to use both to print. we can only do
1. sysout(queue.remove())
instead of
1. sysout(queue.peek())
2. queue.remove()
@@codersdock2374 peek would take O(1) and pop would take O(n)
Please upload videos frequently ...and complete the course ...please...and thanks for wonderful content
Yes please
I really liked your teaching style and it is excellent!
However, in this Queue Implementation, a few things need to modify.
1. We should not use the static method while creating Data structures like Stack, array, LinkedList, and queue because we should use static for utility classes in order to check like-string to upper-class and lower-class, etc.
2. In this queue data structure, we need to store some value that is the purpose.
3 .When to use the static class:
Static should use when you give some input and act on that and return something. It never persists in anything.
in your program, you used the static class Queue-it should Non-static Queue class.
Overall, I really enjoyed your every video. you are doing a really great job. Keep it up!!!
plzz maam make video on binary tree , heapmap, graph also ur teaching way is awesome very easy to understand... I m from electrical background and watch every video if I know coding it all because of u .... u r great mentor
Hi Team , so basically content is too much good and guys are also lovely one thing i would like to inform you that during teaching the concept you speed should be little bit slow then we can understand better with good mindset your every video too much helpful , needful for us. Thanks a lot to you guys for creating such a nice content. A lot of love from my side. :)
congratulations aman bhaiya shardha didi and all the members of apna college family aaj hamri family 1 million ki ho gyi. ye ham sabhi kabhi glorious moment hai
Mam NFT , meta verse , or block chain technology, web 3.0 kya hai or iska future kya hai , eak video mere liye bhi bana do plz
Kuch nhi
Wa bhai tu toh 2035 ki zindagi soch raha hei🎉
😊😊😊😊😊😊😊😊😊😊😊😊😊
Pijush hai Bhai vo kuch bhi kr skta hai @@techbittu47
ma'am, tbh u r just an angel for me thanks for the teaching. A most understanding and a teacher with all behaviors of a student just a complete package. Thanks a lot.
😶🌫
arraydequeue is faster than linked list but when it comes on time sensitive applications we use linked list, because of its cache and operation time taking
Great explaination, I was struggling with the topic but now it's clear.
Thanks
Wow 😍
I like you
M aapke saari video dekhta hu
Very nice and informative video, very well explained without creating any confusion.
Thanks to you.
🙏🏻🙏🏻🙏🏻🙏🏻Didi pls continue these series and pls make regular videos it's an humble request, it's Truly necessary🙏🏻🙏🏻🙏🏻🙏🏻
+1
difference between arraydeque and linked list The general-purpose implementations include LinkedList and ArrayDeque classes. The Deque interface supports insertion, removal and retrieval of elements at both ends. The ArrayDeque class is the resizeable array implementation of the Deque interface, whereas the LinkedList class is the list implementation.
The basic insertion, removal and retrieval operations in the Deque interface addFirst, addLast, removeFirst, removeLast, getFirst and getLast. The method addFirst adds an element at the head whereas addLast adds an element at the tail of the Deque instance.
The LinkedList implementation is more flexible than the ArrayDeque implementation. LinkedList implements all optional list operations. null elements are allowed in the LinkedList implementation but not in the ArrayDeque implementation.
In terms of efficiency, ArrayDeque is more efficient than the LinkedList for add and remove operation at both ends. The best operation in a LinkedList implementation is removing the current element during the iteration. LinkedList implementations are not ideal structures to iterate.
The LinkedList implementation consumes more memory than the ArrayDeque implementation.
Wonderful explanation. Could you put english subtitles to understand better
1 million subscribers completed just now😯😯😯
The best page I've ever come across. Thank you, your examples after explaining are the cherry on the cake.💝
Please if possible can you post the video a little more frequently
Otherwise it will take a lot of time to complete the series
Ma'am , please upload the next videos, we are eagerly waiting for that.
This is premium lectures of Java♥️
1. Why do you define the add, remove and peek methods as static? They should be instance methods and, therefore, not static
2. Why do you define the static class queue? Skip it and write its code as the body of the Queue class
In addition, I suggest implementing the internal linked List using a sentinel head node. The sentinel does not contain valid data, only zero. This simplifies the implementation of the various methods.
33:33 At line no. 16
It should be
return head == null && tail == null;
Dear mam please provide full lecture series one by one video lectures continuously
Thank you very much didi. You are doing great job... But video is tooo late
Advance congrats didi to hit 1 million ..
Pls upload next videos
Please didi😥
And thank you so much , great content . Love you 3000
Thank you very much didi. You are doing great job...I follow this java placement course.
Please tell how to make a doubly linked list. In linked list video, there is only one type of linked list
Mam please upload videos regularly I'm a final year student it will be very helpful for me please @apna college
Tomorrow 1 million subscribers wali didi
Ab aap videos upload kroge ya nhi atleast itna bta do.... Taaki hm khi or se pdh le..... Aap pr depend na rhe...... Please.......hmm aapki videos ka intzar kr rhe h
Thank you so much didi apki bajha se coding mein itna kuch sikh paya
mam please about the dot(.) opration in java how to use this opration
Congratulation for 1million subscribers 👍
Api Kia ap distribute database system k lecture day Sakti Hy ap mashallah Bhat Acha c lecture dati Hy Allah ap ko Zindagi ma Bhat kamyab kry or homes Kashi Rakh ap ki team ko bi
I was waiting for this video.
Thanks 😊👍
Maybe in long term this wi fetch you guys more views and good for the channel.
But, we, who are subscribing today and making the channel big don't get to enjoy the perks of this channel.
This course was started in my 6th, and my 7th sem is about to end. Such inconsistentcy.
Thank you mam for your support🙏🙏 i am eagerly waiting for your videos
How peek operation in queue implementation using array taking O(n) time? Should not it be O(1)?
mam please upload more lectures of question solving in this seriesss....
Hi shrada ,please upload competitive coding with DP.As a python and c++ coder I never learned java that seriously but your courses are very helpful to relearn things.
dsa is same for all langauge infact it is not for one langauge ...concept same hai just acc to lanaguage chize change krni hoti hai
Please add video frequently. Complete the course.
Didi tree and graph ke bhi vidoes jaldhi upload karo
THANK YOU Guyzz
mam , plz upload videos regularly ...wonderful content
Osm vedio ma'am. It's very helping us ☺
..
di aapne QUEUE k notes STACK naam se save kiye h,jo hme confuse kr rha h
Thank you for lecture
Ohh it's about to be 1M😍
Array peek is taking is o(1) but while explaining there is o(n) is mentioned
How an BCA student can get an internship?
Great Job Didi
U r amazing 🤍
Love from Bangladesh 🇧🇩❤️
Hello, have you planned for graph data structure details, example video? if , possibly when?
Someone have idea how much lectures are left in java ?
Thanks a lot, we appreciate your efforts, but kindly continue uploading ahead so that we can be consistent in our learning, please help us complete this course that we have started!
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.
hi ma'am I think time complexity of peek function using array in queue ds is O(1), isn't it?
mam please iss course ke video jaldi jaldi post kiya karo we need it ❤️
Remove operation takes O(n) time in array implementation makes sense but why would peek operation take O(n) time? It will have O(1) constant access time right?
Please made a video on Java developer and how to become a Java developer...
Hello Aman Bhai and Dedi.
Thanks for your efforts.
Next video kab ayege?
Stack ko reverse kar ke pop krenge and fir reverse kar dege and insert karenge o(1) me
Soon 1 Million Didi you deserve it
lecture was v helpful but i think this topics need much time to get full controle over them.
Please make a course on python please your teaching is very awesome
Python mai DSA mat kar
@@mirzahussain3970 kyu?
@@piyushsachdeva2001 most of the company ask you to code in java or c++
Please upload rest of the video so that we can complete this course
is Peek() opperation using array O(n) as u said ? Please correct me. Thanks!!
Please upload videos frequently
Next video kb aaiga.... Agr aap log itna late videos daaloge... To kaise chlega...... Hm khuch bhi nhi krpainge.........
#Apna Collge & shradda didi rocks 👍👍🙌🙌
Mdm jaldi se ye course pura kar djye hmare pas jyda time nhi h placement ko plzzzz
mam please upload videos regularly , we are waiting.......for new videos
Sharadha Didi plz make a playlist OF DSA with lots of question with your explanation videos
Mam c++ ka one shot video banao plz
Shraddha di plz video daliye
Course ko continue kijiye
8:17 Queue mai delete karne par rear piche nahi aayega,,,, front ek bar aage ayega just little bit mistake from Microsoft wali didi🥰😂😂
Please teach python like c+
Good explanation, just a quick question: On geeks for geeks, it's shown that the time complexity of array with queue during the usage of remove and peek functions is O(1) whereas in your video it is shown as O(n). Can you please clear this doubt?
Thank you!
you may be seeing for circular queue
@@aniketsrivastava1870 Nope, its queue only
keep subtitles also please so that people who dont understand hindi can aslo go through
Congratulations for 1 million subs🥳
❤️❤️❤️❤️
Indians in line in sabzi mandi....🤣🤣🤣🤣😂😂😂
Mam I am studying degree 2nd year we learning data structure in that queue topic is there.thank u I am understood very well your class.I don't know hindi very well ....
But your explanation superb and easily understand :)
why are we not implementing Queue using ArrayList instead of an Array since it won't have any fixed size.
Hi Shradha, love your videos but below classes also implement queue interface- AbstractQueue, ArrayBlockingQueue, ArrayDeque, ConcurrentLinkedDeque, ConcurrentLinkedQueue, DelayQueue, LinkedBlockingDeque, LinkedBlockingQueue, LinkedList, LinkedTransferQueue, PriorityBlockingQueue, PriorityQueue, SynchronousQueue why you didnt involve all?Any specific resaon
Assalam o Alikum, kindly upload the new Video, we are very eagerly waiting to learn the new concept of Java.
priority queue and double ended queue would have been great if was added.
Please Introduce Course of System Design as well
Dii upload further videos also...Complete DSA in JAVA
Please complete the series we are waiting. If you really want to helps us then please complete this java series we are getting disappointed the delay you are doing. Please complete it.
guys in implementation in array why is the tc of peek is O(n), as we return only using the index then the tc should be O(1). Help me out if u know..
Ma'am, Next video upload kijiye
When I executed the program with
Queue q= new ArrayDeque();
And,
Queue q= new LinkedList();
It shows "The type Queue is not generic;"
How to solve this?
Congratulations fro 10 million 😘💯
Congratulations 1milion advance 🎉
Make DSA video on c