VerseIsland
FeedLearnLeaderboardGuidesReferenceExploreSearchDocsVerse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Browse UEFN›Verse Language·Up to UEFN · Verse Language·74 of 123 in Verse Language

Stacks and Queues

Stacks and Queues

Overview

Overview

Stacks and queues are common data structures in computer science that specify the order in which you can add and remove elements. You can use them to control the order in which you interact with data:

  • Stack: a container where you insert and remove elements in a first-in, last-out (FILO) order, such as picking a book off the top of a stack of books to read.
  • Queue: a container where you insert and remove elements in a first-in, first-out (FIFO) order, such as processing a line of customers waiting for a meal.

Although the underlying code for stacks and queues are similar, they each have key differences and strengths you can leverage to make your experience fast, efficient, and intuitive.

Stacks

You can think of a stack as a stack of pancakes. Suppose you’re at a breakfast restaurant, and your waiter gives you an endless stack of pancakes. Because you want to be polite, you’re only going to take one pancake at a time, and only from the top of the stack. You can ask your waiter to push a new pancake to the top of your stack, and when you’re hungry you can pop a pancake off the top of the stack and onto your plate to eat it. If you want to eat a specific pancake in the middle of the stack, you’ll have to keep eating pancakes from the top till you get to the one you want. The first pancake added is going to be the last one you remove. This makes a stack a FILO, or first-in, last-out data structure.

You're reading a preview

The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.

Sign in with Discord — free for members Read the original at Epic Games documentation

Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.

Guided course

Add this to your free study plan — we’ll suggest related material and stitch it into one compile-checked lesson.

Keep exploring
More in Verse Language · 74 of 123
Prev
specifiers and attributes in verse
Next
string in verse
Browse all files in this folder (A–Z)

Source

Epic Games documentation

View original

Last updated 2024-12-05T00:00:00+00:00

VerseIsland· an archipelago of Verse & UEFN knowledge
🗺️ Island atlasLearnGuidesHistoryAbout & PressSources & LicensingPrivacy PolicyTermsStatus

Not affiliated with Epic Games. Fortnite, UEFN, Unreal Engine, and Verse are trademarks of Epic Games, Inc. Content is attributed to its source — see Sources & Licensing.

🦜

Scout · your island guide

The Isle of Verse