CS102 - Number Systems, Binary Ops, Search/Sort Algorithms Quiz

Ace your homework & exams now with Quizwiz!

What is the largest number (in decimal) that you can hold with 4 binary digits?

15

Give the result of the following operation in hexadecimal. Both capital and lowercase letters are accepted if needed. 0x4A & 0xB7 = 0x

2

Convert 0b0001_1010 to decimal.

26

Convert 0b0010_0111 to decimal.

39

Convert 0x44 to decimal.

68

Convert 0b0101_1111 to hexadecimal. Both capital and lowercase letters are accepted if needed. 0x

5F

Convert 0x3C to decimal.

60

I am running the insertion sort algorithm, and currently at element 10 (the third element in the list). This is the state of my array: {15, 20, 10, 5, 35, 25}. What step do I take next?

10 will be placed before 15, and 15 and 20 will be shifted to the right by one index

Give the result of the following operation in binary. Place the first four digits in the first blank, and the second four digits in the second blank. ~(0011 0101) =

1100 1010

Convert 29 (decimal) to binary. Use 8 bits: 4 digits in the first blank, and 4 digits in the second blank. 0b

0001 1101

Give the result of the following operation in binary. Place the first four digits in the first blank, and the second four digits in the second blank. (0110 1101) & (0011 0101) =

0010 0101

Give the result of the following operation in binary. Place the first four digits in the first blank, and the second four digits in the second blank. (0110 1101) ^ (0011 0101) =

0101 1000

Convert 0x62 to binary. Use 8 bits: 4 digits in the first blank, and 4 digits in the second blank. 0b

0110 0010

Give the result of the following operation in binary. Place the first four digits in the first blank, and the second four digits in the second blank. (0110 1101) | (0011 0101) =

0111 1101

Which list correctly orders the numbers in order from smallest to largest?

0b0101, 0b0110, 0b1001, 0b1010

Which sorting algorithm divides the array into sorted and unsorted sublists?

Selection

The ~ operation will...

flip all bits.

With selection sort, we find the final position for an element with each step.

true

Given this array: { 16, 32, 7, 12 , 22, 13, 3, 5 } What is the order of the array after 3 steps of bubble sort? Place one element in each blank below.

{ 16, 7, 12, 32, 22, 13, 3, 5 }


Related study sets

12-14 GU - electrolytes and acid base - kruger

View Set

Unit 2: Expressions and Equations

View Set

Chapter Exam - Health Insurance Policy Provisions

View Set

Ch. 38 (NO CH. BUT WITH 36 & 39)

View Set

Government Intervention: Spotlight on China and Germany, Regional Economic Integration – Outlook for the European Union, Airbus vs. Boeing

View Set

Managing Change & Org Transformation

View Set

CHAPTER 58: CARE OF PATIENTS WITH LIVER PROBLEMS

View Set