Name: Adham Shafiqui B.
Michael
Section: Bsinfotech A1
Subject: Data structures and algorithms
Define the following term and give example in a word document and attached your file here.
List - Lists are sequence containers that support iteration in both directions and constant time insert and
erase operations anywhere within the sequence.
//example of a list in C++.
#include <iostream>
#include <list>
int main() {
std::list<int> mylist = {1, 2, 3};
mylist.push_front(0);
for (int x : mylist) {
std::cout << x << " ";
mylist.pop_back();
for (int x : mylist) {
std::cout << x << " ";
return 0;
Linked Lists - Linked lists are a basic data structure that is widely used in programming. They can be used
to store and manipulate data, as well as to create complex algorithms.
Arrays - A data structure called an array holds a fixed-size, ordered collection of identical-type elements.
As opposed to defining distinct variables for each value, arrays are used to hold numerous values in a
single variable.
// example of an Arrays
string cars[4] = {"AE86", "mercedes benz", "GTR", "skyline"};
cout << cars[0];
Stack - Stacks in Data Structures are a linear type of data structure that adheres to the LIFO (Last-In-
First-Out) principle and permits insertion and deletion operations from one end of the stack data
structure, that is top.
Queues - A queue is a data structure that stores and manipulates elements in a specific order using the
FIFO (First In, First Out) principle.