logo

Crowdly

Browser

Додати до Chrome

Questions Bank (1569365 total)

Given the decimal number 26.480. Represent the number in signed magnitude fixed point with 9 bits (1 bit sign + 5 bits integer part + 3 bits fractional part.

Example of an answer: 5.0 is represented by: 000101000

Переглянути це питання
What is the space complexity of merge sort (excluding the array being sorted)?
❌
❌
✅
❌
❌
Переглянути це питання

What is the worst-case time complexity of merge sort?

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

Recall merge sort:

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

RETURN MergeSort(a, 0, n-1)

MergeSort(a, lo, hi)

IF lo >= hi

        RETURN a[lo..hi]

mid ← (lo + hi + 1) DIV 2

l ← MergeSort(a, lo, mid-1)

r ← MergeSort(a, mid, hi)

RETURN Merge(l, r)

where DIV is division discarding any remainder to return a whole number.

Merge(l[0..q-1], r[0..s-1])

m ← a new array of length q+s

i ← 0

j ← 0

WHILE i < q OR j < s

        IF i < q AND (j = s OR l[i] <= r[j])

                m[i+j] ← l[i]

                i ← i+1

        ELSE

                m[i+j] ← r[j]

                j ← j+1

RETURN m

 

Consider a merge sort of the following array:

0123456789
1712827184699143

 

What values will be assigned to the variables l and r in the outermost call of MergeSort?

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

What is the space complexity of selection sort (excluding the array being sorted)?

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

What is the worst-case time complexity of selection sort?

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

Recall selection sort:

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

i ← 0

WHILE i < n-1

        min ← i

        j ← i+1

        WHILE j < n

                IF a[j] < a[min]

                        min ← j

                j = j + 1

        swap the elements of a at positions i and min

        i ← i + 1

 

Consider a selection sort of the following array:

 

01234567891011
LEXICOGRAPHY

 

What is the state of the array at the end of the third iteration of the outer loop?

 

0%
❌
0%
0%
0%
Переглянути це питання
Вкажіть синонімічну назву алеутської хвороби норок:
❌
✅
❌
❌
❌
❌
Переглянути це питання
atualmente, ler o ficheiro /etc/passwd dá-me acesso:
✅
❌
❌
❌
Переглянути це питання