import {test, expect} from '../../fixtures/test' // Canvas quiz questions are stored as HTML in the RCE. Multiple choice // questions use
What is the time complexity of binary search?
True or False: A linked list has O(1) random access.
What does this function return when called with f(5)?
def f(n):
if n <= 1:
return 1
return n * f(n - 1)
Enter the numeric answer:
`, ) expect(content).toContain('What does this function return') expect(content).toContain('def f(n)') expect(content).toContain('return 1') expect(content).toContain('Enter the numeric answer') }) test('matching question with two columns', async ({page}) => { const content = await setAndGet( page, `Match each data structure to its average search time:
| Structure | Time |
|---|---|
| Array | O(n) |
| Hash table | O(1) |
| BST | O(log n) |