Lists: Glossary

    Lists: Glossary

      Abstract data type (ADT): An abstract structure in computer science used for storing information. Any time you aren't dealing directly with pointers and addresses in memory, you're looking at a data type that's been abstracted to make things easier for you to understand, whether it's a stack, queue, list, tree, graph, or even an object.

      Allocate: To set aside or reserve space in computer memory. Arrays love allocating space for things, even if they never see any data.

      Array: A list of sequentially stored items, each with its own reference number (index) and slot in memory. This is the closest thing to a real-life list that you'll see in computer science.

      Call stack: A stack used for storing functions and variables when you run a program. Some programming languages don't use stacks, but you have to be vewwy, vewwy careful when dealing with memory.

      Circular list: A linked list where the last node references back to the first, like a snake eating its tail. (We never really understood that metaphor, since a snake eating its tail would probably have a pretty short lifespan, but whatever.)

      Dequeue: To remove an element from a queue. Since you're dealing with a queue, that always happens at the front.

      Doubly-linked list: A linked list with two references per node (one pointing to the next node and the other pointing to the previous one).

      Enqueue: To add an element to a queue. Since you're dealing with a queue, that always happens at the back.

      FIFO (or LILO): Sounds like a cute name for a lap dog, but it's also an acronym for a First-In-First-Out data structure like a queue, where the first element in is also the first thing out.

      Head: The first element of a linked list.

      LIFO (or FILO): Sounds like someone wanted to turn the word, "life," into two syllables for a slant rhyme, but it actually stands for Last-In-First-Out data structures, which say that...the last thing in is that first thing out. Stacks are great at implementing this type of structure.

      Linked list: A list made up of elements (nodes) that are connected by pointers from one element to the next.

      Node: An element in a linked list. Because they have more than just the important data, but metadata like a pointer to the next element, you can't just call them elements.

      Pop: To remove an element from a stack. It's like popping the cap off a bottle of pop, except…it's more like having a stack of pop caps you can pop the top off of.

      Push: To add an element to a stack. Just don't push too hard, or the whole computer might fall over.

      Queue: An abstract data type (ADT) that has a FIFO structure. You can either represent it with a linked list or array, but you might hurt the other's feelings. You've been warned.

      Singly linked list: A linked list where each node only points to the next node in the list.

      Stack: An abstract data type (ADT) with a LIFO structure. If you use an array or a linked list, you'll want to make sure that the top of that stack is the easiest way to access the list. For an array, that means adding and removing elements from the end. For a linked list, that means…adding and removing elements from the tail.

      Stack frame: The space reserved on the call stack for an individual function and its variables.

      Stack overflow: The error you get if you try and make your call stack too big. If you try to use more memory than you have, the program will crash—hopefully without taking the operating system down with it.

      Stack trace: A print version of the current call stack and all its frames. If your program crashes, this is the first place to look for the place that caused the crash. Or you could ignore it and search through the thousands of lines of code for that missing curly brace. It's your call.

      Tail: The last element of a linked list.