Which of the following real world scenarios would you associate with a stack data structure?
Anonymous Quiz
74%
piling up of chairs one above the other
13%
people standing in a line to be serviced at a counter
6%
offer services based on the priority of the customer
6%
tatkal Ticket Booking in IRCTC
๐1
Explanation:
Stack follows Last In First Out (LIFO) policy. Piling up of chairs one above the other is based on LIFO, people standing in a line is a queue and if the service is based on priority, then it can be associated with a priority queue. Tatkal Ticket Booking Follows First in First Out Policy. People who click the book now first will enter the booking page first.
Stack follows Last In First Out (LIFO) policy. Piling up of chairs one above the other is based on LIFO, people standing in a line is a queue and if the service is based on priority, then it can be associated with a priority queue. Tatkal Ticket Booking Follows First in First Out Policy. People who click the book now first will enter the booking page first.
๐1
Sorry I've forwarded it wrong, here is a complete post:
image_2025-01-31_16-39-23.png
143.1 KB
Common Data Structure Operations and
Array Sorting Algorithms
Array Sorting Algorithms
It could be useful to have it as a cheat sheet
๐3
SC15.png
195.6 KB
SQL EXECUTION ORDER
SQL Doesnโt Run the Way You Think It Does!
Most people assume SQL runs top to bottomโ
but in reality, the database follows a completely different process.
Hereโs what actually happens when you hit Run:
๐น FROM & JOIN โ First, SQL figures out where to pull the data from.
๐น WHERE โ Then, it filters out rows that donโt match your conditions.
๐น GROUP BY โ If needed, it groups the remaining rows together.
๐น HAVING โ Now, it filters those groups (not individual rows).
๐น SELECT โ Finally, it picks the columns you asked for.
๐น ORDER BY โ It sorts the result.
๐น LIMIT โ At the very end, it restricts the output.
Why does this matter?
โคท You canโt use column aliases in WHERE
because SELECT runs later.
โคท Filtering after grouping (HAVING)
is less efficient than filtering before (WHERE).
โคท Understanding this helps you write faster, better queries.
Most analysts assume SQL reads queries like English.
โ But databases have their own logicโand mastering it makes
you a 10x better analyst!
SQL Doesnโt Run the Way You Think It Does!
Most people assume SQL runs top to bottomโ
but in reality, the database follows a completely different process.
Hereโs what actually happens when you hit Run:
๐น FROM & JOIN โ First, SQL figures out where to pull the data from.
๐น WHERE โ Then, it filters out rows that donโt match your conditions.
๐น GROUP BY โ If needed, it groups the remaining rows together.
๐น HAVING โ Now, it filters those groups (not individual rows).
๐น SELECT โ Finally, it picks the columns you asked for.
๐น ORDER BY โ It sorts the result.
๐น LIMIT โ At the very end, it restricts the output.
Why does this matter?
โคท You canโt use column aliases in WHERE
because SELECT runs later.
โคท Filtering after grouping (HAVING)
is less efficient than filtering before (WHERE).
โคท Understanding this helps you write faster, better queries.
Most analysts assume SQL reads queries like English.
โ But databases have their own logicโand mastering it makes
you a 10x better analyst!
๐4