Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 17 pages
Exam (elaborations)

CSE 240 EXAM 1 HIGH-YIELD ARRAYS, STACKS, QUEUES, AND BASIC COMPLEXITY ANALYSIS SUMMARY 2026

Document preview thumbnail
Preview 3 out of 17 pages

CSE 240 EXAM 1 HIGH-YIELD ARRAYS, STACKS, QUEUES, AND BASIC COMPLEXITY ANALYSIS SUMMARY 2026

Content preview

CSE 240 EXAM 1 HIGH-YIELD ARRAYS, STACKS,
QUEUES, AND BASIC COMPLEXITY ANALYSIS
SUMMARY 2026

◉ Given the Scheme code, answer the following questions.
((lambda (x)
((lambda (x y)
(+ x y))
4 (* 6 x)))
3)
(1) The value to be passed to the parameter y is 18 .
(2) The final output of the piece of code is 22 .
Answer: (1) 18


(2) 22


◉ Given the Scheme code, answer the following two questions.
((lambda (x)
((lambda (x y)
(+ x y))

,5 (* 7 x)))
3)
(1) The value to be passed to the parameter y is 21 .
(2) The final output of the piece of code is 26 .
Answer: (1) 21
(2) 26


◉ Given this Scheme procedure:




(define foo (lambda (x)
(if (= x 0)
1
(* x (foo (- x 1))) )))
What does this procedure do?
Answer: compute x!


◉ Which of the following forms using a quote will return an error
when run?
Answer: ('+ 2 3)
(define a a)

, ◉ Which of the followings is a Scheme pair? Select all that apply.
Answer: '(x . y)
'(x . x)
'(() ())


◉ What is the correct method for constructing a pair in Scheme?
Answer: (cons 1 2)


◉ What is the return value of the code below? (min is a procedure
that returns the minimum of two values.)
(define lst '(3 5 2 9))
((min (car lst) (cadr lst)))
Answer: error message


◉ What statement is accurate and correct for Scheme lists and
pairs?
Answer: There exists a list that is not a pair.


◉ Which of the following is equivalent to the expression below?
(car (cdr '(1 2 3 4 5))
Answer: (cadr '(1 2 3 4 5))

Document information

Uploaded on
August 25, 2026
Number of pages
17
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$15.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
TopGradeInsider
4.2
(13)
Sold
165
Followers
2
Items
55375
Last sold
11 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions