Search Header Logo

CSE334_Practice Set2

Authored by Pushpendra Pateriya

Computers

University

Used 1+ times

CSE334_Practice Set2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The preorder traversal of a binary search tree is 15, 10, 12, 11, 20, 18, 16, 19. Which one of the following is the postorder traversal of the tree?

20, 19, 18, 16, 15, 12, 11, 10

19, 16, 18, 20, 11, 12, 10, 15

11, 12, 10, 16, 19, 18, 20, 15

10, 11, 12, 15, 16, 18, 19, 20

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the worst-case time complexity of inserting n elements into an empty linked list, if the linked list needs to be maintained in sorted order?

Θ(n^2)

Θ(1)

Θ(n)

Θ(n log n)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the worst-case time complexity of inserting n^2 elements into an AVL tree with n elements initially?

Θ(n^2 log n)

Θ(n^2)

Θ(n^4)

Θ(n^3)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following C program. What is the output of this program? #include struct Ournode{ char x,y,z; }; int main(){ struct Ournode p = {'1', '0', 'a'+2}; struct Ournode *q = &p; printf ("%c, %c", *((char*)q+1), *((char*)q+2)); return 0; }

0, c

0, a+2

'0', 'a+2'

'0', 'c'

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following C Program void f(int, short); void main() { int i = 100; short s = 12; short *p = &s; ___________ ; // call to f() } Which one of the following expressions, when placed in the blank above, will NOT result in a type-checking error?

f(i, *p)

i = f(i,s)

f(s, *s)

f(i, *s)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efficiently. Which one of the following statements is CORRECT (n refers to the number of items in the queue)?

The worst-case time complexity for both operations will be Ω(n)

Worst case time complexity for both operations will be Ω(log n)

At most one operation can be performed on O(1) time but the worst-case time for the other operation will be Ω(n)

Both operations can be performed in O(1) time

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The result evaluating the postfix expression 10 5 + 60 6/ * 8 – is

284

71

213

142

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers