logo

Crowdly

Browser

Додати до Chrome

IN1002 Introduction to Algorithms (PRD2 A 2024/25)

Шукаєте відповіді та рішення тестів для IN1002 Introduction to Algorithms (PRD2 A 2024/25)? Перегляньте нашу велику колекцію перевірених відповідей для IN1002 Introduction to Algorithms (PRD2 A 2024/25) в moodle4.city.ac.uk.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

Consider the language of all strings consisting of some number of as followed by the same number of bs, e.g. epsilon, ab, aabb, aaabbb, and so on.

Which of the following is true?

0%
0%
0%
0%
0%
Переглянути це питання

Consider the context-free grammar S:

S rightwards arrow a S b S | b S a S | epsilon

 

Which of the following strings does not belong to the context-free language described by S?

0%
0%
0%
0%
Переглянути це питання

Assuming the alphabet { a, b }, which of the following regular expressions does not describe the set of all strings containing at least one b?

Переглянути це питання

Consider the following finite state machine:

A finite state machine with 5 states:   Q0 is the start state.  Q2 and Q4 are accept states.  From q0 an a input transitions to q1. From q0 a b input transitions to q3.  From q1 an a input transitions to q1. From q1 an b input transitions to q2.  From q2 an a input transitions to q1. From q2 a b input transitions to q2.  From q3 an a input transitions to q4. From q3 an b input transitions to q3.   From q4 an a input transitions to q4. From q4 a b input transitions to q3.

Which of the following strings does not belong to the language recognized by this machine:

0%
0%
0%
0%
0%
Переглянути це питання

Consider the following finite state machine:

A finite state machine with 5 states:   Q0 is the start state.  Q2 and Q4 are accept states.  From q0 an a input transitions to q1. From q0 a b input transitions to q3.  From q1 an a input transitions to q1. From q1 an b input transitions to q2.  From q2 an a input transitions to q1. From q2 a b input transitions to q2.  From q3 an a input transitions to q4. From q3 an b input transitions to q3.   From q4 an a input transitions to q4. From q4 a b input transitions to q3.

What state is reached after scanning the string  "babbba''?

Переглянути це питання

Which of the following problems is undecidable?

0%
0%
0%
0%
0%
Переглянути це питання

Suppose it is proven that P != NP.

Which of the following would then be a consequence?

Переглянути це питання

What is the time complexity of the following algorithm?

Shift(a[0..n-1])

i ← 0

sum ← 0;

WHILE i < n

        sum ← sum + a[i]

        i ← i+1

average ← sum / n

i ← 0

WHILE i < n

        a[i] ← a[i]-average

        i ← i+1

0%
0%
0%
0%
Переглянути це питання

What is the time complexity of an algorithm that calls an O(n2) method, an O(n log n) method and then an O(2n) method?

0%
0%
0%
0%
Переглянути це питання

Suppose that sequential search is called 100 times.

What is the worst-case time complexity of these 100 calls?

Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на moodle4.city.ac.uk?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome