The lisp function length counts

Assignment Help Basic Computer Science
Reference no: EM13164582

Write a function DOT-PRODUCT that takes two lists, each list has three numbers (elements), and produces the dot product of the vectors that they represent. For example,

-> (DOT-PRODUCT '(1.2 2.0 -0.2) '(0.0 2.3 5.0))

            -> 3.6

Write a function COUNT-NUMBER that counts the number of numbers that occur in a list. It should work like this:

-> (COUNT-NUMBER '(A 2.3 B 5 4.53 C F))

            -> 3

Write a function NEW-LIST that takes a number as its argument and constructs a list of that length containing all Ts. For example,

-> (new-lit 5)

-> (T T T T T)

The Lisp function LENGTH counts the number of elements in the top level of a list. Write a function ALL-LENGTH of one argument that counts the number of atoms that occur in a list at all levels.  Thus, the following lists will have the following ALL-LENGTHs.

(A B C)                                   => 3

            ((A (B C) D (E F))      => 6

            (NIL NIL (NIL NIL) NIL )   => 5

Reference no: EM13164582

What elements are necessary for support

What type of maintenance plan needs to put into place to support the new infrastructure? What elements are necessary for support? How often are upgrades needed? What unfores

What are the next significant technological innovations

What are the next significant technological innovations. This week's reading introduces the software development lifecycle model and discusses how information systems are dev

Character using the cin object

Write a C++ program that accepts a character using the cin object and determines whether the character is a lowercase letter. Alowercase letter is any character that is grea

Explain computer etiquette for effective communication

Each day we should be careful to insure that personal information is not compromised. Computer etiquette is difficult for effective communication.

History of project best practices

As a newly minted CIO, you have been hired to join a company without a history of project best practices. Suggest strategy and process for your Chief Executive Officer (CEO)

David has a rectangular garden that measures

David has a rectangular garden that measures 11 feet by 13 feet. He wants to plant peas in hisgarden. Dad said that one seed packet will be enough to fill a space 10 feet on

Write a python function to get the first half

Write a Python function to get the first half of a specified string of even length. Suppose the input string is "Python", after calling the function, we should see the outpu

Cidr-summarization and vlsm

Discuss specific situations when you would use CIDR, summarization, and VLSM. Each method used all involves moving the network/node line to the right or to the left. Describ

Reviews

Write a Review

 
Free Assignment Quote

Assured A++ Grade

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!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd