1/54
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Array
_____ is a container which can hold a fix number of items and these items should be of the same type.
Arrays
Most of the data structures make use of _______ to implement their algorithms.
Element
Each item stored in an array is called an _______
Index
Each location of an element in an array has a numerical _______, which is used to identify the element.
Traverse
print all the array elements one by one
Insertion
Adds an element at the given index.
Deletion
Deletes an element at the given index.
Search
Searches an element using the given index or by the value.
Update
Updates an element at the given index
importing
Array is created in Python by ______ array module to the python program
Typecode
_________ are the codes that are used to define the type of value the array will hold.
b
Represents signed integer of size 1 byte
B
Represents unsigned integer of size 1 byte
u
Represents character of size 2 bytes
i
Represents signed integer of size 2 bytes
I
Represents unsigned integer of size 2 bytes
f
Represents floating point of size 4 bytes
d
Represents floating point of size 8 bytes
lists
In Python, we can treat _____ as arrays. However, we cannot constrain the type of elements stored in this.
stack
A ______ is a linear data structure that follows the principle of Last In First Out (LIFO).
Last In First Out (LIFO)
This means the last element inserted inside the stack is removed first.
stack
You can think of the ______ data structure as the pile of plates on top of another.
push, pop
In programming terms, putting an item on top of the stack is called _____ and removing an item is called _____.
Push
Add an element to the top of a stack
Pop
Remove an element from the top of a stack
IsEmpty
Check if the stack is empty
IsFull
Check if the stack is full
Peek
Get the value of the top element without removing it
TOP
A pointer called ___ is used to keep track of the top element in the stack
-1, TOP == -1
When initializing the stack, we set its value to ___ so that we can check if the stack is empty by comparing _____
pushing
On _______ an element, we increase the value of TOP and place the new element in the position pointed to by TOP
popping
On _______ an element, we return the element pointed to by TOP and reduce its value
full
Before pushing, we check if the stack is already _____
empty
Before popping, we check if the stack is already ______
queue
A _____ is a useful data structure in programming. It is similar to the ticket queue outside a cinema hall, where the first person entering the queue is the first person who gets the ticket.
First In First Out (FIFO) rule
Queue follows the _______, the item that goes in first is the item that comes out first.
enqueue, dequeue
In programming terms, putting items in the queue is called _____, and removing items from the queue is called ______.
an abstract data structure - ADT
A queue is an object (___________)
Enqueue
Add an element to the end of the queue
Dequeue
Remove an element from the front of the queue
IsEmpty
Check if the queue is empty
IsFull
Check if the queue is full
Peek
Get the value of the front of the queue without removing it
simple queue
In a ________, insertion takes place at the rear and removal occurs at the front. It strictly follows the FIFO (First in First out) rule
circular queue
In a _______, the last element points to the first element making a circular link.
priority queue
A _______ is a special type of queue in which each element is associated with a priority and is served according to its priority.
order
If elements with the same priority occur, they are served according to their _____ in the queue.
Insertion, removal
_______ occurs based on the arrival of the values and ______ occurs based on priority.
double ended queue
In a _______, insertion and removal of elements can be performed from either from the front or rear. Thus, it does not follow the FIFO (First In First Out) rule.
linked list
In ______ data structure, data elements are connected through a series of nodes. And, each node contains the data items and address to the next node.
Singly Linked List
It is the most common. Each node has data and a pointer to the next node.
Doubly Linked List
Add a pointer to the previous node. Thus, it can go in either direction: forward or backward.
Circular Linked List
is a variation of a linked list in which the last element is linked to the first element. This forms a circular loop.
head
_____ points to the first node of the linked list
NULL
next pointer of the last node is _____, so if the next current node is _____, we have reached the end of the linked list.