Exercise 64. The Manhattan distance of a point to the origin considers a path th
ID: 3809487 • Letter: E
Question
Exercise 64. The Manhattan distance of a point to the origin considers a path that follows the rectangular grid of streets found in Manhattan. Here are two examples:
The left one shows a “direct” strategy, going as far left as needed, followed by as many upwards steps as needed. In comparison, the right one shows a “random walk” strategy, going some blocks leftwards, some upwards, and so on until the destination—here, the origin—is reached.
Stop! Does it matter which strategy you follow?
Exercise 65. Take a look at following structure type definitions:
(define-struct movie [title producer year])
(define-struct person [name hair eyes phone])
(define-struct pet [name number])
(define-struct CD [artist title price])
(define-struct sweater [material size producer])
Construct your own family tree as far as you know: you, your siblings, your biological parents and biological grandparents (or legal same); or make three generations up. Feel free to add your own children if you have some.
Create function that returns a grandparent that you decide - use HtDF.
Explanation / Answer
I am answering question no 72 and 73, as the other question you asked doesn't have proper context to it.
Question 72:
No, the strategy doesn't matter. If You are starting in first strategy or second, the number of steps you take to reach the destination will remain same.. like in the pcture, three horizontal steps and 4 vertical steps.. so in total you walk the same.. whatever route you follow.
Question 73:
struct movie {
char *title;
char *producer;
int year;
}
struct person {
char *name;
char *hair;
char *eyes;
long phone;
}
struct pet {
char *name;
int number;
}
struct CD {
char *artist;
char *title;
double price;
}
struct sweater {
char *material;
int size;
char *producer;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.