100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

Computer Engineering 2

Rating
-
Sold
-
Pages
24
Grade
A+
Uploaded on
16-03-2025
Written in
2024/2025

Computer Engineering 2

Institution
Computer Engineering
Course
Computer engineering










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Computer engineering
Course
Computer engineering

Document information

Uploaded on
March 16, 2025
Number of pages
24
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Content preview

1. The binary representation of the decimal number -6 in 8-bit two's complement is:

A. 11111010

B. 10000110

C. 11111001

D. 10000011

Answer: A) 11111010

Rationale: The two's complement of -6 in 8-bit binary is 11111010. First, write 6 in

binary (00000110), then invert the bits (11111001), and finally add 1 (11111010).




2. What is the largest number that can be represented by a 4-bit binary number?

A. 15

B. 16

C. 14

D. 17

Answer: A) 15

Rationale: A 4-bit binary number can represent values from 0000 (0 in decimal) to

1111 (15 in decimal). So, the largest value is 15.




3. What is the time complexity of bubble sort?

A. O(n)

,B. O(n^2)

C. O(log n)

D. O(n log n)

Answer: B) O(n^2)

Rationale: Bubble sort compares adjacent elements and swaps them if needed. This

process is repeated for each element, resulting in a time complexity of O(n^2).




4. Which data structure is best suited for implementing a priority queue?

A. Array

B. Stack

C. Heap

D. Queue

Answer: C) Heap

Rationale: A heap is an efficient data structure for implementing a priority queue

because it allows quick access to the highest (or lowest) priority element.




5. The worst-case time complexity of quicksort is:

A. O(n log n)

B. O(n^2)

C. O(n)

D. O(log n)

Answer: B) O(n^2)

, Rationale: In the worst case, when the pivot selection is poor, the quicksort algorithm

has a time complexity of O(n^2).




6. In binary arithmetic, what is the result of 1101 + 1011?

A. 11000

B. 11010

C. 10111

D. 10000

Answer: A) 11000

Rationale: The binary addition of 1101 and 1011 is as follows:

markdown

Copy

1101

+ 1011

-------

11000




7. The main function in C programming language is called:

A. void()

B. main()

C. start()

D. entry()
$10.99
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
douglasmugwe82
5.0
(1)

Get to know the seller

Seller avatar
douglasmugwe82 Teachme2-tutor
View profile
Follow You need to be logged in order to follow users or courses
Sold
2
Member since
1 year
Number of followers
0
Documents
4239
Last sold
3 months ago
fully answered questions and answer

fully answered questions and answer

5.0

1 reviews

5
1
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions