Solve using lisp program not python or java. ( lisp emacs ) Write a function called filter-seq
Fantastic news! We've Found the answer you've been seeking!
Question:
Solve using lisp program not python or java. ( lisp emacs )
Transcribed Image Text:
Write a function called filter-seq that takes a sequences (a string) and an alphabet a (a string), and generates a result sequence (a string) by including only the characters of s that occur in the alphabet a. The unit test below includes test cases that your solution for this exercise must pass. (deftest test-filter-seq () (check (equal (filter-seq "sdafgacs" "abcf") "afac") (equal (filter-seq "" "abcf") "") (equal (filter-seq "sdafgacs" "") "") (equal (filter-seq "sdafgacs" "abcfs") "safacs"))) Write a function called filter-seq that takes a sequences (a string) and an alphabet a (a string), and generates a result sequence (a string) by including only the characters of s that occur in the alphabet a. The unit test below includes test cases that your solution for this exercise must pass. (deftest test-filter-seq () (check (equal (filter-seq "sdafgacs" "abcf") "afac") (equal (filter-seq "" "abcf") "") (equal (filter-seq "sdafgacs" "") "") (equal (filter-seq "sdafgacs" "abcfs") "safacs")))
Expert Answer:
Answer rating: 100% (QA)
we use lisp program USER24 first 2 4 8 2 USER25 rest 2 4 8 4 USER26 ... View the full answer
Posted Date:
Students also viewed these programming questions
-
An 8.155 kg block was placed on an inclined plane (35 degrees with respect to the horizontal). A 150 N horizontal force is applied on the block. The coefficients of static and kinetic friction are...
-
Write Emacs Lisp scripts to (a) Insert todays date into the current buffer at the insertion point (current cursor location). (b) Place quote marks (" ") around the word surrounding the insertion...
-
Using the Java program by Lenth (2011) referred to earlier, calculate power for the Adams et al. (1996) data in Table 14.2 on homophobia.
-
Under which of the following circumstances would an auditor be most likely to intensify an challenging examination of a $500 imprest petty cash fund a. Reimbursement occurs twice each week. b. The...
-
Refer to the financial statements for Tobolowsky Hats Inc. in Problem 12-78B and the data below. Required: 1. Prepare all the financial ratios for Tobolowsky for 2011 and 2010 (using percentage terms...
-
Draw the shear and moment diagram for thebeans E kip/ft 8 kip/ft B- 9 ft + -9 ft 9ft- -9 ft-
-
The magnitude of the gravitational force exerted by Earth on an object of inertia \(m_{1}\) is \(m_{1} g\). (a) What is the magnitude of the force exerted by the object on Earth (inertia...
-
The plant assets section of the comparative balance sheets of Anders Company is reported below. Refer to the balance sheet data above from Anders Company. During 2015, equipment with a book value of...
-
25 25 A piece of wire of resistance R is cut into three equal parts. These parts are then connected in parallel. If the equivalent resistance of this parallel combination is R, what is the value of...
-
Record the following transactions in General Ledger accounts of the General Fund of Fergieville. 1. Incurred salaries of $300,000, $280,000 of which was paid. 2. A long-term note ($400,000 face...
-
Write a short note on the 12 fun facts about color purple.
-
Provide a listIterator method for the ArrayList implementation in Section 16.2.3. Your method should return an object of a class implementing java.util.ListIterator. Also have the ArrayList class...
-
Show that the introduction of the size method in Exercise E16.6 does not affect the big-Oh efficiency of the other list operations. Data from exercise E16.6 Add an instance variable currentSize to...
-
Assume that a BankAccount class has methods for yielding the account owners name and the current balance. Write a function that, given a list of bank accounts, produces a map that associates owner...
-
Design an algorithm for deciding whether two binary trees have the same shape. What is the running time of your algorithm?
-
Write a method that reverses all lines in a file. Read all lines, reverse each line, and write the result.
-
Summary: Texas Paint & Coatings (TPC) is a producer of specialty paints and coatings for industrial and agricultural equipment manufacturers. Currently, TPC is in the process of introducing a new...
-
An environmentalist wants to determine if the median amount of potassium (mg/L) in rainwater in Lincoln County, Nebraska, is different from that in the rainwater in Clarendon County, South Carolina....
-
Jose Medellin participated in the rape and murder of two teenage girls in Houston, Texas. He was arrested and read his Miranda rights, and he confessed. At the time, he was not informed that he could...
-
As you have seen in this chapter, international trade law is founded on the importance and benefits of removing trade barriers. However, WTO rules also recognize the need to restrain trade in certain...
-
Could a contract be difficult to categorize as either public or private international law? What would such a contract look like?
Study smarter with the SolutionInn App