pROG Flashcards
What does a pointer store?
Address of a variable
Which operator is used to access the value stored at the memory address held by a pointer?
*
What is the correct way to declare a pointer to an integer?
int pointer;
Which keyword is used to free dynamically allocated memory?
delete
Which of the following is a correct way to declare an array of 10 integers?
int arr[10];
Are dynamic data structures that provide flexibility and efficient operations compared to static arrays
Linked List
Check if the stack is empty.
IsEmpty
A pointer can point to any data type.
True
An array in C++ can store different types of data in the same array.
FALSE
When dynamically allocating an array, you must free the memory using delete[].
True
Is used to retrieve the address of a variable.
The address-of operator (&)
Which of the following is the correct way to define a structure?
struct myStruct{ int x; float y; };
Points to the next node in the list
Next Pointer
Visiting each node in the linked list, usually to read or process the data stored in each node.
Traversal
Remove the element from the front of the queue.
Dequeue
Finding a node in the linked list that contains a specific value.
Search
Enhance traversal capabilities, allowing for easy movement in both directions.
Doubly Linked List
The value held by the node.
Data
Adding a new node to the linked list. This can be done at various positions:
Insertion
Add an element to the top of the stack.
Push
Points to the previous node in the list.
Previous Pointer
Return the front element without removing it.
Peek
A pointer/reference to the first node in the list.
Head
Return the top element without removing it.
Peek
Linked lists can grow or shrink as needed, unlike arrays which have a fixed size.
Dynamic Size
Add an element to the end of the queue.
Enqueue
Remove the element from the top of the stack.
Pop
The basic unit of a linked list that contains data and a pointer to the next node.
Node
A pointer/reference to the last node in the list (optional).
Tail
Removing a node from the linked list. This can involve:
Deletion
Basic Operations on Data Structures ARAU
Adding Data: (Create | Insert).
Removing Data:(Delete).
Accessing Data:(Search | Read).
Updating Data: (Update).
Like a row of boxes where each box has a number.
-A simple list where each item is stored in a specific order
ARRAYS
Like a chain of linked rings, where each ring points to the next one.
- A list where each item points to the next one in line.
LINKED LISTS
Like a stack of plates where you add and remove from the top.
-A collection where the last item added is the first one to be removed (Last In, First Out - LIFO).
STACKS
Like a line at a checkout where the first person in line is the first one served.
-A collection where the first item added is the first one to be removed (First In, First Out - FIFO).
QUEUES