Lesson 14 of 24
set, stack, queue, priority_queueset, stack, queue and priority_queue
11 min 35 XP
set: தனித்துவமான, வரிசைப்படுத்தப்பட்ட மதிப்புகள். stack: கடைசியாக வந்தது முதலில் வெளியே (LIFO). queue: முதலில் வந்தது முதலில் (FIFO). priority_queue: எப்போதும் பெரியது மேலே.
set holds unique sorted values. stack is last-in-first-out (LIFO), queue is first-in-first-out (FIFO), and priority_queue always keeps the largest on top.
Example: edit me and press Run
Press Run to see the result here.Balanced brackets சோதனை stack-ன் மிகப் பிரபலமான interview கேள்வி: திறக்கும் bracket-ஐ push, மூடும் bracket வந்தால் top பொருந்துகிறதா என்று பார்த்து pop.
Balanced brackets is the classic stack interview question: push opening brackets; on a closing bracket, check the top matches and pop.