MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
An empty list is the one which has no ____
A
Nodes
B
Data
C
Address
D
Both a & b
Explanation: 

Detailed explanation-1: -An empty list is the one which has no data and nodes. It is a list that contains no data records. This is usually the same as saying it has zero nodes. If sentinel nodes are being used, the list is usually said to be empty when it has only sentinel nodes.

Detailed explanation-2: -You can create an empty list using an empty pair of square brackets [] or the type constructor list(), a built-in function that creates an empty list when no arguments are passed. Square brackets [] are commonly used in Python to create empty lists because it is faster and more concise.

Detailed explanation-3: -The list() function returns an empty list if no arguments is passed to it. However, if data values are passed to it as arguments, the list() function returns the data values in the iterable.

Detailed explanation-4: -A linked list is held using a local pointer variable which points to the first item of the list. If that pointer is also NULL, then the list is considered to be empty.

There is 1 question to complete.