Midterm Flashcards

(30 cards)

1
Q

“The process of solving a problem by reducing it to smaller
versions itself is called __________________”

A

“The process of solving a problem by reducing it to smaller
versions itself is called recursion”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

________ - the case for which the solution is obtained directly

A

Base case - the case for which the solution is obtained directly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

_______________ - “A definition in which something is defined
in terms of a smaller version of itself.”

A

Recursive definition - “A definition in which something is defined
in terms of a smaller version of itself.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

___________________ - “An algorithm that finds the solution to a
given problem by reducing the problem to smaller versions of itself”

A

Recursive algorithm - “An algorithm that finds the solution to a
given problem by reducing the problem to smaller versions of itself
is called recursive algorithm”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

“A method that calls itself is called a __________”

A

recursive method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

“A method is called ________________ if it calls itself”.

A

“A method is called directly recursive if it calls itself”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

“A methods that calls another method and eventually results in the
original method call is said to be ____________”

A

indirectly recursive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

“A ___________ is a collection of components,called nodes. Every
node(except the last node) , contains the address of the next
node”

A

linked list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

“Linked List is a _____________, in which elements are not
stored at a contiguous location, rather they are linked using
pointers. Linked List forms a series of connected nodes, where
each node stores the data and the address of the next node.”

A

linear data structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

“In a _____________, each node contains a reference to the next
node in the sequence. Traversing a singly linked list is done in a
forward direction.”

A

“In a singly linked list, each node contains a reference to the next
node in the sequence. Traversing a singly linked list is done in a
forward direction.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

“In a ____________, each node contains references to both the
next and previous nodes. This allows for traversal in both forward
and backward directions, but it requires additional memory for the
backward reference.”

A

“In a doubly linked list, each node contains references to both the
next and previous nodes. This allows for traversal in both forward
and backward directions, but it requires additional memory for the
backward reference.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

“ In a _______________, the last node points back to the head
node, creating a circular structure. It can be either singly or doubly
linked..”

A

“ In a circular linked list, the last node points back to the head
node, creating a circular structure. It can be either singly or doubly
linked..”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

__________: Linked lists can grow or shrink dynamically, as
memory allocation is done at runtime.

A

Dynamic Size: Linked lists can grow or shrink dynamically, as
memory allocation is done at runtime.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

________________: Adding or removing elements from a linked
list is efficient, especially for large lists.

A

Insertion and Deletion: Adding or removing elements from a linked
list is efficient, especially for large lists.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

____________: Linked lists can be easily reorganized and modified
without requiring a contiguous block of memory.

A

Flexibility: Linked lists can be easily reorganized and modified
without requiring a contiguous block of memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

_____________: Unlike arrays, linked lists do not allow direct
access to elements by index. Traversal is required to reach a
specific node.

A

Random Access: Unlike arrays, linked lists do not allow direct
access to elements by index. Traversal is required to reach a
specific node.

17
Q

__________: Linked lists require additional memory for storing the
pointers, compared to arrays.

A

Extra Memory: Linked lists require additional memory for storing the
pointers, compared to arrays.

18
Q

_______: It holds the actual value or data associated with the node.

A

Data: It holds the actual value or data associated with the node.

19
Q

__________: It stores the memory address (reference) of the
next node in the sequence.

A

Next Pointer: It stores the memory address (reference) of the
next node in the sequence.

20
Q

_____: The linked list is accessed through the head node, which
points to the first node in the list.

A

Head: The linked list is accessed through the head node, which
points to the first node in the list.

21
Q

“A _______________ is a linked list in which every node has a
reference of the next node and a reference of the previous node.
In other words, every node(except the last node) contains the
address of the next node and every node(except the first node)
contains the address of the previous node.”

A

“A doubly linked list is a linked list in which every node has a
reference of the next node and a reference of the previous node.
In other words, every node(except the last node) contains the
address of the next node and every node(except the first node)
contains the address of the previous node.”

22
Q

_________: The size of a doubly linked list can change dynamically,
meaning that nodes can be added or removed as needed.

A

Dynamic size: The size of a doubly linked list can change dynamically,
meaning that nodes can be added or removed as needed.

23
Q

_____________: In a doubly linked list, each node contains pointers to
both the previous and next elements, allowing for navigation in both forward
and backward directions.

A

Two-way navigation: In a doubly linked list, each node contains pointers to
both the previous and next elements, allowing for navigation in both forward
and backward directions.

24
Q

_____________: Each node in a doubly linked list requires memory for two
pointers (previous and next), in addition to the memory required for the data
stored in the node.

A

Memory overhead: Each node in a doubly linked list requires memory for two
pointers (previous and next), in addition to the memory required for the data
stored in the node.

25
___________: The doubly linked list structure allows for navigation in both forward and backward directions, making it easier to traverse the list and access elements at any position.
Two-way navigation: The doubly linked list structure allows for navigation in both forward and backward directions, making it easier to traverse the list and access elements at any position.
26
_______________________: The doubly linked list structure allows for the efficient insertion and deletion of elements at any position in the list. This can be useful in situations where elements need to be added or removed frequently.
Efficient insertion and deletion: The doubly linked list structure allows for the efficient insertion and deletion of elements at any position in the list. This can be useful in situations where elements need to be added or removed frequently.
27
___________: The doubly linked list can be used to implement a wide range of data structures and algorithms, making it a versatile and useful tool in computer science.
Versatility: The doubly linked list can be used to implement a wide range of data structures and algorithms, making it a versatile and useful tool in computer science.
28
___________: Each node in a doubly linked list requires memory for two pointers (previous and next), in addition to the memory required for the data stored in the node. This can result in a higher memory overhead compared to a singly linked list, where only one pointer is needed.
Memory overhead: Each node in a doubly linked list requires memory for two pointers (previous and next), in addition to the memory required for the data stored in the node. This can result in a higher memory overhead compared to a singly linked list, where only one pointer is needed.
29
________________: Access times for individual elements in a doubly linked list may be slower compared to arrays, as the pointers must be followed to access a specific node.
Slower access times: Access times for individual elements in a doubly linked list may be slower compared to arrays, as the pointers must be followed to access a specific node.
30
________________: The doubly linked list structure requires more manipulation of pointers compared to arrays, which can result in more complex code and potential bugs.
Pointer manipulation: The doubly linked list structure requires more manipulation of pointers compared to arrays, which can result in more complex code and potential bugs.