1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Scrat [10]
3 years ago
5

Write Scheme functions to do the following. You are only allowed to use the functions introduced in our lecture notes and the he

lper functions written by yourself. (a) Return all rotations of a given list. For example, (rotate ’(a b c d e)) should return ((a b c d e) (b c d e a) (c d e a b) (d e a b c) (e a b c d)) (in some order). (b) Return a list containing all elements of a given list that satisfy a given predicate. For example, (filter (lambda (x) (< x 5)) ’(3 9 5 8 2 4 7)) should return (3 2 4).
Computers and Technology
1 answer:
klio [65]3 years ago
7 0

Answer:

Check the explanation

Explanation:

solution a:

def Rotate(string) :

n = len(string)

temp = string + string

for i in range(n) :

for j in range(n) :

print(temp[i + j], end = "")

print()

string = ("abcde")

Rotate(string)

solution b:

nums = [3,9,5,8,2,4,7]

res = list(filter(lambda n : n < 5, nums))

print(res)

You might be interested in
Why is the access date important to include when citing a website? (select all that apply)
julsineya [31]

Answer:

It indicates website accessibility changes.

5 0
3 years ago
Read 2 more answers
Objective:This assignment is designed to give you experience with thinking about algorithm analysis and performanceevaluation.Pr
wolverine [178]

Answer:

Check the explanation

Explanation:

#include<stdio.h>

/*Function to return max sum such that no two elements

are adjacent */

int FindMaxSum(int arr[], int n)

{

 int incl = arr[0];

 int excl = 0;

 int excl_new;

 int i;

 for (i = 1; i < n; i++)

 {

    /* current max excluding i */

    excl_new = (incl > excl)? incl: excl;

    /* current max including i */

    incl = excl + arr[i];

    excl = excl_new;

 }

  /* return max of incl and excl */

  return ((incl > excl)? incl : excl);

}

/* Driver program to test above function */

int main()

{

 int arr[] = {5, 5, 10, 100, 10, 5};

 printf("%d \n", FindMaxSum(arr, 6));

 getchar();

 return 0;

}

7 0
3 years ago
Computer design replaced ______________
photoshop1234 [79]
The answer is c.-architectural talent and an eye for design.
4 0
4 years ago
Which is the correct sequence of steps for opening a new document?
ollegr [7]
Basic steps start with opening the program, clicking on File, then clicking on New for a new document.

Most programs open a new blank document when you open he program.
6 0
3 years ago
Read 2 more answers
Please help me. Adnan also wants to add a photograph of a bridge. It is on another PowerPoint presentation that is open in a dif
Nana76 [90]
C. screen clipping feature
7 0
3 years ago
Other questions:
  • IBF Consultants, LLC provides consulting services in privacy and theft deterrence solutions. Another client has very sensitive d
    7·1 answer
  • ________________ occur when a system produces incorrect, inconsistent, or duplicate data.
    6·2 answers
  • A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and county s
    11·1 answer
  • ______ is a slow process that takes place in nature. (2 points)
    8·1 answer
  • A domain name is used to: *
    15·1 answer
  • Power point presentation make use of pages known as
    9·2 answers
  • linda has written a program that works well on various operating systems, but she needs to increase the readability of the progr
    5·1 answer
  • Examples of how the development of coding changed the way we live. What type of technology was created as a result of code?
    10·1 answer
  • Sftp uses which mechanism to provide security for authentication and data transfer?
    7·1 answer
  • The first time that a particular visitor loads a web site page is called a(n) _____.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!