Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
1. Write a function vecmul that will take as inputs two simple lists of numbers. vecmul should multiply these lists element-wise as one would multiply vectors. Assume the two lists are of the same length. [For example, (vecmul '(2 3 4 5) '(1 4 5 2)) returns (2*1 3*4 4*5 5*2) or (2 12 20 10).] (5 Marks)2. Define function addvec and use vecmul to define a product function innpuch to find sum of the products, such as, (innprod '(1 2 3) '(7 8 9)) returns 1*7 + 2*8 + 3*9 or 50. (5 Marks)3. Define a function last1 which returns the last element of a list (at the top level) without making use of reverse or last (already built in to Common Lisp.) (5 Marks)4. Write a reverse function srev which reverses all lists that occur in an S-expression at any level. Thus (srev '((a b (c d)) e (f g))) should yield ((g f) e ((d c) b a)). (5 Marks)5. Write a function insert1 which takes its first integer argument and inserts it at the correct place in its second argument, a list of integers sorted in increasing order, so that (insert1 3 '(1 4 6 6 7)) produces (1 3 4 6 6 7). (5 Marks)6. Use insert to write a function sort1 which sorts a list of integers into increasing order. [We are done if the list is nil. Otherwise insert the car of the list into the sorted cdr]. (5 Marks)7. Define a function occurrence that takes a list and returns a list indicating the number of times each (eql) element appears, sorted from most common element to least common.(5 Marks)Example:(occurrences '(a b a d a c d c a)) ?((A 4) (C 2) (D 2) (B 1))8. Your friend is trying to write a function that returns the sum of all the non-nil elements in a list to help you to submit assignment on your behalf. He has written two versions of this function and neither of them work. Explain what is wrong with each, and give a correct version. (2?5 Marks)(1 nil 4 5 nil 8 9 nil nil) => 27(a) (defun summit (lst)(remove nil lst)(apply #'+ lst))(b) (defun summit (lst)(let ((x (car lst)))(if (null x)(summit (cdr lst))(+ x (summit (cdr lst))))))9. Suppose the function pos+ takes a list and returns a list of each element plus its position. (10 Marks)(pos+ '(7 5 1 4))? (7 6 3 7)Define this function using (a) recursion (b) iteration.
Compare American's fast food culture and Italian's slow food concept. what is different between?
Can you please provide a brief description of three important skills needed to establish a successful therapeutic alliance? Then, explain possible barriers that may impede implementing these skills.
Suppose that after the criminal case is settled Tyler Clementi's family attempts to sue Dharun Ravi on behalf of Tyler in civil court for the tort of invasion of privacy. Please provide the basic elements of the tort of invasion of privacy in New Jer..
Since there is no one theory/therapy that applies to all people, eclecticism is the ideal manner in which to provide therapeutic treatment.
Design a program that asks for the price of each item, and then displays the subtotal of the sale, the amount of the sales tax and the total. The sales tax is 6 percent. I also need help with developing a flowchart we are using raptor.
Explain the character also you can in one page. Write characteristics: what do details tell you about character as a person? As representative of their occupation or position in society?
Discuss how the new technology works, what method or product the new technology is designed to replace, why the new technology is preferable to the old method or product, how this new technology benefits a print media corporation, the public, or both..
Please describe the â??emergency administrative searchâ? exception to the general rule that a warrant must be issued for a lawful search. a) What is â??reasonable suspicionâ? in the context of the 4th Amendment?
The methodology Morgan used to investigate foreign cultures included
How do these paradigms relate to the general concerns of nineteenth-century West European sociologists and their thinking about race and ethnicity?
With increasing numbers of inter-racial marriages, there will be many more people claiming bi-racial and multi-racial identities in the decades to come.
Research way company is organized, its business philosophy, and its niche in marketplace. Write down report which would be helpful to other students who might be interested in seeking employment there.
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd