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
View Answer
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
View Answer
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?
a) Links
b) List
c) Variables
d) Right pointers
View Answer
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
View Answer
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
View Answer
Explanation: Cons builds new lists by depositing pointers in free boxes.
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
View Answer
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
View Answer
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)) * (delete 'heads toss) * toss
a) Heads tails
b) Heads tails tails tails tails
c) Heads
d) None of the mentioned
View Answer
Explanation: This statement will print the result by mainpulation of delete.
Output:
(HEADS TAILS TAILS TAILS TAILS)
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
View Answer
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
View Answer
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.
To practice all areas of LISP, here is complete set of 250+ Multiple Choice Questions and Answers on LISP Programming Language.
- Practice Computer Science MCQs
- Check Computer Science Books
- Apply for Computer Science Internship
- Check LISP Books