No video

Java Tutorial #51 - Java PriorityQueue Class with Examples (Collections)

  Рет қаралды 15,302

Programming For Beginners

Programming For Beginners

2 жыл бұрын

Java Tutorial #51 - Java PriorityQueue Class with Examples (Collections)
In this video by Programming for Beginners we will learn Java PriorityQueue Class with Examples, using Java Tutorial videos.
The PriorityQueue class provides the functionality of the heap data structure.
Unlike normal queues, priority queue elements are retrieved in sorted order.
Suppose, we want to retrieve elements in the ascending order. In this case, the head of the priority queue will be the smallest element. Once this element is retrieved, the next smallest element will be the head of the queue.
NOTE: The elements of a priority queue may not be sorted. However, elements are always retrieved in sorted order.
PriorityQueue Methods:
add() method
offer() method
peek() method
remove() method
poll() method
Using Iterator for PriorityQueue objects.
==========
We can learn Java Programming language to make web applications or mobile applications for android phones and several other applications for windows, Mac OS and Unix operating systems. Also we can make android applications using Java programming. The concepts covered will be related to basic java and core java that will help you in your next interview questions. You can use any version of Java but all concepts will be same for all java versions. I will be using Java SE 8.
Java is a high-level programming language. Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.
Java is a MUST for students and working professionals to become a great Software Engineer specially when they are working in Software Development Domain.
Java Tutorial for Beginners Playlist:
• Java Tutorial
Java JDK:
www.oracle.com...
Eclipse IDE:
www.eclipse.or...
KZbin Gears:
Microphone: amzn.to/3iIk5K3
Mouse: amzn.to/35irmNF
Laptop: amzn.to/3iG0jyD
#JavaTutorial #JavaForBeginners #Programming #Java
============================
LIKE | SHARE | COMMENT | SUBSCRIBE
Thanks for watching :)

Пікірлер: 16
@MahaDev-cx1ij
@MahaDev-cx1ij Ай бұрын
Very impressive and wow presentation
@programmingforbeginners7392
@programmingforbeginners7392 Ай бұрын
Thank you 😊
@sravanipudu
@sravanipudu Ай бұрын
I am very confused about this concept.. now it's all cleared my doubts .. thank you
@programmingforbeginners7392
@programmingforbeginners7392 Ай бұрын
Glad to hear that
@paarthiban8452
@paarthiban8452 Жыл бұрын
At last I understood the algorithm behind the priority queue...really nice work buddy.👌
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
Thank you so much.. please share with your friends and subscribe to the channel 🙂👍
@ACUCSPRADEEPB-up9ne
@ACUCSPRADEEPB-up9ne Жыл бұрын
Wow 👍
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
Thanks 👍
@jeyanthan360
@jeyanthan360 Жыл бұрын
For a capacity-constrained queue, the difference between add() and offer() methods are, add() always returns true and throws an exception if it can't add the element, whereas offer() is allowed to return false if it can't add the element.
@thesquarefish
@thesquarefish Жыл бұрын
Don't know if you'll see this message but why would anyone use add() over offer() if add() might error and offer() won't?
@jeyanthan360
@jeyanthan360 Жыл бұрын
@@thesquarefish if you know that the queue has enough capacity to hold the element you want to add, it is generally better to use the add() method. On the other hand, if you are not sure whether the queue has enough capacity or not, or if you want to handle queue overflow gracefully, you can use the offer() method. And actually add() method was created first . After sometimes, from the problem faced by the add() ,offer() has been created. So most text books are using the old methods as an example for adding elements in a priority queue, these youtube videos are also teaching in traditional bookish way. But offer() is good compared to add() we can use that too, totally our choice.
@thesquarefish
@thesquarefish Жыл бұрын
@@jeyanthan360 But from a purely functional standpoint, offer() is always equal to or better than add()?
@jeyanthan360
@jeyanthan360 Жыл бұрын
@@thesquarefish Yessss u r Right
@thesquarefish
@thesquarefish Жыл бұрын
@@jeyanthan360 Ok thank u for answering
@nishikantmandaokar9353
@nishikantmandaokar9353 Жыл бұрын
You r good.. but lil bit more knowledge is there then it will be good
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
Ok
Java Tutorial #52 - Java Deque Interface with Examples (Collections)
8:11
Programming For Beginners
Рет қаралды 6 М.
Priority Queue Explained | Min and Max Heap | Custom Comparator
23:19
Daily Code Buffer
Рет қаралды 19 М.
Алексей Щербаков разнес ВДВшников
00:47
Bony Just Wants To Take A Shower #animation
00:10
GREEN MAX
Рет қаралды 6 МЛН
لااا! هذه البرتقالة مزعجة جدًا #قصير
00:15
One More Arabic
Рет қаралды 51 МЛН
#95 Comparator vs Comparable in Java
15:43
Telusko
Рет қаралды 169 М.
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1 МЛН
Java Tutorial #67 - Java TreeSet Class with Examples (Set Data Structure)
12:04
Programming For Beginners
Рет қаралды 6 М.
9. Java Memory Management and Garbage Collection in Depth
48:48
Concept && Coding - by Shrayansh
Рет қаралды 67 М.
Set and HashSet in Java - Full Tutorial
20:43
Coding with John
Рет қаралды 210 М.
LinkedList vs ArrayList in Java Tutorial - Which Should You Use?
11:43
Coding with John
Рет қаралды 584 М.
Heaps, heapsort, and priority queues - Inside code
19:01
Inside code
Рет қаралды 79 М.
Lambda Expressions in Java - Full Simple Tutorial
13:05
Coding with John
Рет қаралды 729 М.