← All Online Coding Lessons Flashcard Decks

Data Structures and Algorithms Flashcards

6 cards from real Online Coding Lessons practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 6 Data Structures and Algorithms flashcards as text
  1. What is an array in programming?

    Answer: A collection of elements stored at contiguous memory locations

    An array is a data structure that stores a fixed-size collection of elements of the same type at contiguous memory locations.

  2. What is the time complexity of a linear search algorithm?

    Answer: O(n)

    Linear search has O(n) time complexity because in the worst case, it must check every element in the list once.

  3. What is a stack data structure?

    Answer: A structure where elements follow Last-In-First-Out (LIFO) order

    A stack is a linear data structure that follows the Last-In-First-Out (LIFO) principle, where the last element added is the first to be removed.

  4. Which sorting algorithm works by repeatedly swapping adjacent elements if they are in the wrong order?

    Answer: Bubble Sort

    Bubble Sort works by repeatedly comparing and swapping adjacent elements until the list is sorted, causing larger values to 'bubble' to the end.

  5. What is a queue data structure?

    Answer: Elements follow First-In-First-Out (FIFO) order

    A queue is a data structure that follows the First-In-First-Out (FIFO) principle, like a line of people waiting — the first in is the first out.

  6. What does 'index' mean in the context of an array?

    Answer: The position of an element within the array

    An index is a numerical position used to access a specific element in an array, typically starting from 0.