LISP Questions & Answers – List Storage

This set of LISP Multiple Choice Questions & Answers (MCQs) focuses on “List Storage”.

1. Which is a string of boxes linked by arrow like pointers?
a) Lisp
b) List
c) Variables
d) Pointers

Explanation: A list in box and pointer notation is a string of boxes linked by arrow like pointers.

2. What is the other name of boxes?
a) Cons cells
b) Conses
c) Both Cons cells & Conses
d) None of the mentioned

Explanation: The box is called as atoms and two-pointer entities, in which the boxes can tie together.

3. Which is used to construct new lists by linking the right pointers?
b) List
c) Variables
d) Right pointers

Explanation: Lisp maintains a list of spare boxes, linked by their right pointers for constructing new lists.

4. Which can be represented in bytes?
a) Boxes and pointers
b) Lists
c) Lisp
d) None of the mentioned

Explanation: Boxes and pointers both can be represented in bytes. But lists and LISP can be represented in bytes.

5. Which can build new lists by depositing pointers in free boxes?
a) Do
b) Dobuild
c) Cons
d) None of the mentioned

Explanation: Cons builds new lists by depositing pointers in free boxes.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. What is the output of the given statement?

```span class="sy0"> * (setf abc '(a b c) xyz '(x y z))
* (setf bc (rest abc))
* bc```

a) A
b) B
c) C
d) BC

Explanation: This statement will print BC because of definied variable bc.
Output:
(B C)

7. What is the output of the given statement?

```span class="sy0"> * (setf abc '(a b c) xyz '(x y z))
* abc```

a) A
b) B
c) ABC
d) None of the mentioned

Explanation: This statement is printing abc because of definition.
Output:
(A B C)

8. What is the output of the given statement?

```span class="sy0"> * (setf toss '(heads tails tails tails heads tails))
* toss```

b) Heads tails tails tails tails
d) None of the mentioned

Explanation: This statement will print the result by mainpulation of delete.
Output:

9. What is the output of the given statement?

```span class="sy0"> * (setf fact1 '(big computers are nice))
* (setf (first fact1) 'fast)```

a) Big computers
b) Fast
c) Big computers are fast
d) None of the mentioned

Explanation: This statement will print the given result because of the definition of first.
Output:
FAST

10. What is the output of the given statement?

```span class="sy0"> * (setf l1 (list 'a 'b 'c))
* (setf l2 (list 'a 'b))
* (setf l1 l2)```

a) A B
b) A B C
c) B C
d) None of the mentioned

Explanation: This statement will print the a and b because of computing the intersection of the two values.
Output:
(A B)

Sanfoundry Global Education & Learning Series – LISP Programming Language.