SlideShare a Scribd company logo
1 of 1
Download to read offline
Suppose that L1 is the list (A (BC) and L2 is the list ((D E) F). Give the value of each of the
following LISP expressions: (a) (CONS (CAR L2) (CDR L1)) (b) (CDR (CAR [CONS (CONS
'GL1 '(B)))) (c) (CONS (LIST (CAR L1) (CDR L2)) '(G)) (d) (CDR (LIST L2 'G (CAR
L2)))
Solution
Let us trace the execution of the function to see how the recursive calls unfold:
Everything looks fine, until we trace also the unfolding of list-append:

More Related Content

More from AroraRajinder1

Compare and Contrast hollow core fibers for high power delivery an.pdf
Compare and Contrast hollow core fibers for high power delivery an.pdfCompare and Contrast hollow core fibers for high power delivery an.pdf
Compare and Contrast hollow core fibers for high power delivery an.pdf
AroraRajinder1
 
2015Matthew and Michael Goode (cousins) decide to form a partners.pdf
2015Matthew and Michael Goode (cousins) decide to form a partners.pdf2015Matthew and Michael Goode (cousins) decide to form a partners.pdf
2015Matthew and Michael Goode (cousins) decide to form a partners.pdf
AroraRajinder1
 
1. Jose is a Latino client who presents with occupational difficulti.pdf
1. Jose is a Latino client who presents with occupational difficulti.pdf1. Jose is a Latino client who presents with occupational difficulti.pdf
1. Jose is a Latino client who presents with occupational difficulti.pdf
AroraRajinder1
 
Why can some microbial species grow and survive in extreme environ.pdf
Why can some microbial species grow and survive in extreme environ.pdfWhy can some microbial species grow and survive in extreme environ.pdf
Why can some microbial species grow and survive in extreme environ.pdf
AroraRajinder1
 
Which anchors of synthesis Which are cilia and N Which found in plan.pdf
Which anchors of synthesis Which are cilia and N Which found in plan.pdfWhich anchors of synthesis Which are cilia and N Which found in plan.pdf
Which anchors of synthesis Which are cilia and N Which found in plan.pdf
AroraRajinder1
 
What is social welfare policy Why should we study it What is the r.pdf
What is social welfare policy Why should we study it What is the r.pdfWhat is social welfare policy Why should we study it What is the r.pdf
What is social welfare policy Why should we study it What is the r.pdf
AroraRajinder1
 
What are the six classes of nutrients and there functionsSoluti.pdf
What are the six classes of nutrients and there functionsSoluti.pdfWhat are the six classes of nutrients and there functionsSoluti.pdf
What are the six classes of nutrients and there functionsSoluti.pdf
AroraRajinder1
 
Significance of differences between mitosis and meiosis Mit.pdf
Significance of differences between mitosis and meiosis Mit.pdfSignificance of differences between mitosis and meiosis Mit.pdf
Significance of differences between mitosis and meiosis Mit.pdf
AroraRajinder1
 

More from AroraRajinder1 (20)

DEFINE maternal determinant (3-4 sentences).SolutionMaternal .pdf
DEFINE maternal determinant (3-4 sentences).SolutionMaternal .pdfDEFINE maternal determinant (3-4 sentences).SolutionMaternal .pdf
DEFINE maternal determinant (3-4 sentences).SolutionMaternal .pdf
 
Consider a partial function.For every unmapped element in its doma.pdf
Consider a partial function.For every unmapped element in its doma.pdfConsider a partial function.For every unmapped element in its doma.pdf
Consider a partial function.For every unmapped element in its doma.pdf
 
Compare and Contrast hollow core fibers for high power delivery an.pdf
Compare and Contrast hollow core fibers for high power delivery an.pdfCompare and Contrast hollow core fibers for high power delivery an.pdf
Compare and Contrast hollow core fibers for high power delivery an.pdf
 
Can we create an object of type Interface Explain your answer.So.pdf
Can we create an object of type Interface Explain your answer.So.pdfCan we create an object of type Interface Explain your answer.So.pdf
Can we create an object of type Interface Explain your answer.So.pdf
 
Cancel QuestionSolutionSince Descriptive statistics uses the d.pdf
Cancel QuestionSolutionSince Descriptive statistics uses the d.pdfCancel QuestionSolutionSince Descriptive statistics uses the d.pdf
Cancel QuestionSolutionSince Descriptive statistics uses the d.pdf
 
According to the cladogram, what derived trait is shared by primates .pdf
According to the cladogram, what derived trait is shared by primates .pdfAccording to the cladogram, what derived trait is shared by primates .pdf
According to the cladogram, what derived trait is shared by primates .pdf
 
A male Flagus fly with the Barkus phenotype is crossed with a female.pdf
A male Flagus fly with the Barkus phenotype is crossed with a female.pdfA male Flagus fly with the Barkus phenotype is crossed with a female.pdf
A male Flagus fly with the Barkus phenotype is crossed with a female.pdf
 
2015Matthew and Michael Goode (cousins) decide to form a partners.pdf
2015Matthew and Michael Goode (cousins) decide to form a partners.pdf2015Matthew and Michael Goode (cousins) decide to form a partners.pdf
2015Matthew and Michael Goode (cousins) decide to form a partners.pdf
 
1. Jose is a Latino client who presents with occupational difficulti.pdf
1. Jose is a Latino client who presents with occupational difficulti.pdf1. Jose is a Latino client who presents with occupational difficulti.pdf
1. Jose is a Latino client who presents with occupational difficulti.pdf
 
You have a small business customer who wants to use a voice over IP .pdf
You have a small business customer who wants to use a voice over IP .pdfYou have a small business customer who wants to use a voice over IP .pdf
You have a small business customer who wants to use a voice over IP .pdf
 
Why can some microbial species grow and survive in extreme environ.pdf
Why can some microbial species grow and survive in extreme environ.pdfWhy can some microbial species grow and survive in extreme environ.pdf
Why can some microbial species grow and survive in extreme environ.pdf
 
Which prokaryotic group maps most closely to the chlorophyll of plan.pdf
Which prokaryotic group maps most closely to the chlorophyll of plan.pdfWhich prokaryotic group maps most closely to the chlorophyll of plan.pdf
Which prokaryotic group maps most closely to the chlorophyll of plan.pdf
 
Which of the following static methods allow an ArrayList of strings t.pdf
Which of the following static methods allow an ArrayList of strings t.pdfWhich of the following static methods allow an ArrayList of strings t.pdf
Which of the following static methods allow an ArrayList of strings t.pdf
 
Which of the following factors can affect rate of enzyme activitypH.pdf
Which of the following factors can affect rate of enzyme activitypH.pdfWhich of the following factors can affect rate of enzyme activitypH.pdf
Which of the following factors can affect rate of enzyme activitypH.pdf
 
Which anchors of synthesis Which are cilia and N Which found in plan.pdf
Which anchors of synthesis Which are cilia and N Which found in plan.pdfWhich anchors of synthesis Which are cilia and N Which found in plan.pdf
Which anchors of synthesis Which are cilia and N Which found in plan.pdf
 
What is social welfare policy Why should we study it What is the r.pdf
What is social welfare policy Why should we study it What is the r.pdfWhat is social welfare policy Why should we study it What is the r.pdf
What is social welfare policy Why should we study it What is the r.pdf
 
what is a problem we face due to the small size of microbes What is .pdf
what is a problem we face due to the small size of microbes What is .pdfwhat is a problem we face due to the small size of microbes What is .pdf
what is a problem we face due to the small size of microbes What is .pdf
 
What are the six classes of nutrients and there functionsSoluti.pdf
What are the six classes of nutrients and there functionsSoluti.pdfWhat are the six classes of nutrients and there functionsSoluti.pdf
What are the six classes of nutrients and there functionsSoluti.pdf
 
Use the data set below to answer the following questions. Complete pa.pdf
Use the data set below to answer the following questions. Complete pa.pdfUse the data set below to answer the following questions. Complete pa.pdf
Use the data set below to answer the following questions. Complete pa.pdf
 
Significance of differences between mitosis and meiosis Mit.pdf
Significance of differences between mitosis and meiosis Mit.pdfSignificance of differences between mitosis and meiosis Mit.pdf
Significance of differences between mitosis and meiosis Mit.pdf
 

Recently uploaded

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
中 央社
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
EADTU
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
中 央社
 

Recently uploaded (20)

Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 

Suppose that L1 is the list (A (BC) and L2 is the list ((D E) F). .pdf

  • 1. Suppose that L1 is the list (A (BC) and L2 is the list ((D E) F). Give the value of each of the following LISP expressions: (a) (CONS (CAR L2) (CDR L1)) (b) (CDR (CAR [CONS (CONS 'GL1 '(B)))) (c) (CONS (LIST (CAR L1) (CDR L2)) '(G)) (d) (CDR (LIST L2 'G (CAR L2))) Solution Let us trace the execution of the function to see how the recursive calls unfold: Everything looks fine, until we trace also the unfolding of list-append: