Silvio Peroni

Results 96 issues of Silvio Peroni

Create the test case for the algorithm introduced in [Listing 2](https://comp-think.github.io/2018-2019/lecture-notes/06%20-%20Brute-force%20algorithms.pdf).

Exercise

Write down the execution steps of `linear_search(list(["Coraline", "American Gods", "The Graveyard Book", "Good Omens", "Neverwhere"]), "The Sandman")`, as explained in [Listing 7](https://comp-think.github.io/2018-2019/lecture-notes/06%20-%20Brute-force%20algorithms.pdf).

Exercise

Consider to have a queue obtained by processing, one by one, the elements included in the list of the [first exercise](https://github.com/comp-think/2018-2019/issues/12), i.e. `my_queue = deque(["Draco", "Harry", "Hermione", "Ron", "Severus"])`. Describe...

Exercise

Consider to have a stack obtained by processing, one by one, the elements included in the list of the [first exercise](https://github.com/comp-think/2018-2019/issues/12), i.e. `my_stack = deque(["Draco", "Harry", "Hermione", "Ron", "Severus"])`. Describe...

Exercise

Write a sequence of instructions in Python so as to create a list with the following elements ordered alphabetically: `"​Harry"`​, `"​Draco"`​, `"​Hermione"​`, `​"​Ron"`​, `"​Severus"`​.

Exercise

Following the template in [Listing 11](https://comp-think.github.io/2018-2019/lecture-notes/04%20-%20Programming%20languages.pdf), write in Python the algorithm proposed originally in [Figure 4 of the lecture notes entitled "Algorithms"](https://comp-think.github.io/2018-2019/lecture-notes/02%20-%20Algorithms.pdf) as a flowchart, and accompany such code with...

Exercise

What is the boolean value of `"spam" not in "spa span sparql" and not ("egg" > "span")`?

Exercise

What is the boolean value of `not (not True or False and True) or False`?

Exercise

Consider an algorithm that takes as input a 0-1 sequence of exactly five symbols, and returns 1 if such sequence contains at least three consecutive 1s, and returns 0 otherwise....

Exercise

Write the table of instructions of a Turing machine with four states – A (initial state), B, C, and D (final state) – such that, once reached the final state,...

Exercise