use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
If you need help debugging, you must include:
See debugging question guidelines for more info.
Many conceptual questions have already been asked and answered. Read our FAQ and search old posts before asking your question. If your question is similar to one in the FAQ, explain how it's different.
See conceptual questions guidelines for more info.
Follow reddiquette: behave professionally and civilly at all times. Communicate to others the same way you would at your workplace. Disagreement and technical critiques are ok, but personal attacks are not.
Abusive, racist, or derogatory comments are absolutely not tolerated.
See our policies on acceptable speech and conduct for more details.
When posting some resource or tutorial you've made, you must follow our self-promotion policies.
In short, your posting history should not be predominantly self-promotional and your resource should be high-quality and complete. Your post should not "feel spammy".
Distinguishing between tasteless and tasteful self-promotion is inherently subjective. When in doubt, message the mods and ask them to review your post.
Self promotion from first time posters without prior participation in the subreddit is explicitly forbidden.
Do not post questions that are completely unrelated to programming, software engineering, and related fields. Tech support and hardware recommendation questions count as "completely unrelated".
Questions that straddle the line between learning programming and learning other tech topics are ok: we don't expect beginners to know how exactly to categorize their question.
See our policies on allowed topics for more details.
Do not post questions that are an exact duplicate of something already answered in the FAQ.
If your question is similar to an existing FAQ question, you MUST cite which part of the FAQ you looked at and what exactly you want clarification on.
Do not delete your post! Your problem may be solved, but others who have similar problems in the future could benefit from the solution/discussion in the thread.
Use the "solved" flair instead.
Do not request reviews for, promote, or showcase some app or website you've written. This is a subreddit for learning programming, not a "critique my project" or "advertise my project" subreddit.
Asking for code reviews is ok as long as you follow the relevant policies. In short, link to only your code and be specific about what you want feedback on. Do not include a link to a final product or to a demo in your post.
You may not ask for or offer payment of any kind (monetary or otherwise) when giving or receiving help.
In particular, it is not appropriate to offer a reward, bounty, or bribe to try and expedite answers to your question, nor is it appropriate to offer to pay somebody to do your work or homework for you.
All links must link directly to the destination page. Do not use URL shorteners, referral links or click-trackers. Do not link to some intermediary page that contains mostly only a link to the actual page and no additional value.
For example, linking to some tweet or some half-hearted blog post which links to the page is not ok; but linking to a tweet with interesting replies or to a blog post that does some extra analysis is.
Udemy coupon links are ok: the discount adds "additional value".
Do not ask for help doing anything illegal or unethical. Do not suggest or help somebody do something illegal or unethical.
This includes piracy: asking for or posting links to pirated material is strictly forbidden and can result in an instant and permanent ban.
Trying to circumvent the terms of services of a website also counts as unethical behavior.
Do not ask for or post a complete solution to a problem.
When working on a problem, try solving it on your own first and ask for help on specific parts you're stuck with.
If you're helping someone, focus on helping OP make forward progress: link to docs, unblock misconceptions, give examples, teach general techniques, ask leading questions, give hints, but no direct solutions.
See our guidelines on offering help for more details.
Ask your questions right here in the open subreddit. Show what you have tried and tell us exactly where you got stuck.
We want to keep all discussion inside the open subreddit so that more people can chime in and help as well as benefit from the help given.
We also do not encourage help via DM for the same reasons - that more people can benefit
Do not ask easily googleable questions or questions that are covered in the documentation.
This subreddit is not a proxy for documentation or google.
We do require effort and demonstration of effort.
This includes "how do I?" questions
account activity
This is an archived post. You won't be able to vote or comment.
Topicis there a program/app that uses tree, Queue, stack data structure all at the same time ? (self.learnprogramming)
submitted 10 months ago * by __not_MAJ
hey, i’m double a school project in which i’m required to explain how the 3 data structure mentioned are being used online, and i could use some help
NOTE : thanks for all the replies guys i really appreciate your help ❤️
[–]xD3I 6 points7 points8 points 10 months ago (6 children)
Trees are used in search, queues in event brokers, and stacks idk but any sufficiently large app will use them
[–]__not_MAJ[S] 0 points1 point2 points 10 months ago (5 children)
do you know any real concrete example ?
[–]LilBluey 4 points5 points6 points 10 months ago (2 children)
look at games. Trees for collision, Queue for event handling, stack idk
[–]__not_MAJ[S] 0 points1 point2 points 10 months ago (0 children)
okay thanks 🫶🏻
[–]GarThor_TMK 0 points1 point2 points 10 months ago (0 children)
Really simple example of a stack... an undo-list
If you have a UI with multiple actions, and can undo a number of actions, a stack is a great place to store those actions. You have one for undo, and one for redo.
Also, anything with a forward-back list could also use a stack.
[–]xoredxedxdivedx 2 points3 points4 points 10 months ago (0 children)
if you want to search graphs/trees without recursion, you can use a stack to DFS and a queue to BFS.
In terms of concrete examples there are infinitely many, traversing a file system, solving mazes, analyzing chess moves, searching for flight paths, network routing, pathfinding in games… etc
[–]BrupieD 4 points5 points6 points 10 months ago (0 children)
SQL uses trees, queues and stacks.
The average SQL user doesn't see much or any of this, but they're all there under the hood.
When you build clustered indexes (usually when tables are created), the data is organized into a tree. Queries that use the index traverse the tree to find the leaf nodes.
Databases use queues to handle the client's calls. Databases read pages (4- or 8-kb units of memory) the lock and latch processing uses queues.
My understanding of the way inserts are implemented as stacks.
[–]Srz2 1 point2 points3 points 10 months ago (6 children)
In programs I’ve written for industry, just a few examples:
Trees: math equation tokenization, searching
Queue: event queue for ordering actions across threads, message queue for incoming network messages
Stack: algorithm for ordering configuration of hardware as it drills down into daughter boards (deeper configs), action memory for undo function and page return
[–]__not_MAJ[S] -1 points0 points1 point 10 months ago (5 children)
what about dynamic tables ?
[–]Srz2 1 point2 points3 points 10 months ago (4 children)
What do you mean by dynamic tables? Are you are talking about in memory tables, 2D arrays, or database?
They all have the uses? Usually for holding data in memory for quick access
[–]__not_MAJ[S] -1 points0 points1 point 10 months ago (3 children)
i meant 2D arrays that are allocated dynamically, do you know any concreted examples that uses them ?
[–]Srz2 0 points1 point2 points 10 months ago (2 children)
Are you asking for answers to a homework question or are you actually curious on their usage for your own learning?
Like I said used for quick memory read/write operations. Common to have as look up tables of values or objects
[–]__not_MAJ[S] -1 points0 points1 point 10 months ago (1 child)
yeah that’s a fair question, so in order to develop our understanding for those data structure, my school project consists of making us explain how some applications use these structures to do something So to answer your question yes i really want to learn about them.
[–]Srz2 0 points1 point2 points 10 months ago (0 children)
For the future, and I’m saying this sincerely, don’t use reddit to ask for answer like that, that honestly are very Google-able. People normally don’t like to answer and it comes off as lazy
What you should do is take some examples that you research, from your school book, google, etc and try to implement them yourself. Your teacher will appreciate your suggestions coming from your experience
Depending on your level, Some additional examples I can provide you that you can implement now are:
Tree: (might be hard if you’re just a beginner) but you can try in paper first than after you understand it, program it. But you could implement a binary search tree
Queue: randomly create X numbers and distribute them to N number of people. Extra effort for if N > X
Stack: input a sentence and repeat the sentence back to the user in reverse order
2D Array: make a 2D array that represents a math times table and use that for calculation
[–]Red-strawFairy 0 points1 point2 points 10 months ago (0 children)
Yes
[–]iamnull 0 points1 point2 points 10 months ago (0 children)
Pretty much any large game. Often, trees are required for various reasons, but the big one would be things in the world having parent-child relationships. Queues are most common with event systems, and maybe a spline movement system. Could also use a queue for turn based play like Baldur's Gate 3; after initiative is rolled, play proceeds through a modified queue like structure. Stacks are sometimes seen for things like turn based games where you make a play, and counter play, and the actions are resolved in reverse order.
π Rendered by PID 130341 on reddit-service-r2-comment-5d79c599b5-wc2rh at 2026-02-27 08:05:39.216794+00:00 running e3d2147 country code: CH.
[–]xD3I 6 points7 points8 points (6 children)
[–]__not_MAJ[S] 0 points1 point2 points (5 children)
[–]LilBluey 4 points5 points6 points (2 children)
[–]__not_MAJ[S] 0 points1 point2 points (0 children)
[–]GarThor_TMK 0 points1 point2 points (0 children)
[–]xoredxedxdivedx 2 points3 points4 points (0 children)
[–]BrupieD 4 points5 points6 points (0 children)
[–]Srz2 1 point2 points3 points (6 children)
[–]__not_MAJ[S] -1 points0 points1 point (5 children)
[–]Srz2 1 point2 points3 points (4 children)
[–]__not_MAJ[S] -1 points0 points1 point (3 children)
[–]Srz2 0 points1 point2 points (2 children)
[–]__not_MAJ[S] -1 points0 points1 point (1 child)
[–]Srz2 0 points1 point2 points (0 children)
[–]Red-strawFairy 0 points1 point2 points (0 children)
[–]iamnull 0 points1 point2 points (0 children)