Unit 1 - DSA - AI A

Unit 1 - DSA - AI A

University

10 Qs

quiz-placeholder

Similar activities

TECHNICAL C POINTER JIT04

TECHNICAL C POINTER JIT04

University

8 Qs

STRUKTUR DATA (QUIZ FINAL)

STRUKTUR DATA (QUIZ FINAL)

University

15 Qs

Plot the Code

Plot the Code

University

10 Qs

Arrays in C (II yr 02.07.2020)

Arrays in C (II yr 02.07.2020)

University

10 Qs

pointers and structures

pointers and structures

University

10 Qs

Java

Java

University

10 Qs

C++ linked list

C++ linked list

University

10 Qs

STRUCTURE

STRUCTURE

University

5 Qs

Unit 1 - DSA - AI A

Unit 1 - DSA - AI A

Assessment

Quiz

Computers

University

Hard

Created by

Reshmy Krishnan

Used 3+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What are the disadvantages of arrays?

Index value of an array can be negative

Elements are sequentially accessed

Data structure like queue or stack cannot be implemented

There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the size of the following structure?

#include <stdio.h>
struct temp {
  int a[5];
  char p;
};

6

10

20

24

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the time complexity to insert a single element in the array?

O(1)

O(n)

O(log n)

O(n log n)

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following program?

#include <stdio.h>

int main()

{

int arr[5] = { 2, 6, 8, 13, 19 };

// Modifing the data

for (int i = 0; i < 5; i += 2)

arr[i]++;

for (int i = 0; i < 5; i++)

printf("\t %d", arr[i]);

return 0;

}

2, 6, 8, 13, 19 

3, 6, 9, 13, 20

3, 7, 9, 14, 20

2, 6, 8, 14, 20

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following program?

int main()

{

 

    int arr[ ] = { 1, 2, 3, 4, 5 };

    for (int i = 0; i < 5; i++)

        printf("\t %d", *(arr + i) );

    return 0;

}

1, 3, 5, 7, 9

1200, 1201, 1202, 1203, 1204

1 2 3 4 5

2, 4, 6, 8, 10

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Comment on the following pointer declaration:

int *ptr, p;

ptr is a pointer to integer, p is not.

ptr and p, both are pointers to integer.

ptr is pointer to integer, p may or may not be.

ptr and p both are not pointers to integer.

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is an incorrect syntax for pointer to structure?

struct temp{

int b;

}*my_struct;

*my_struct.b = 10;

(*my_struct).b = 10;

my_struct->b = 10;

Both my_struct.b = 10; and (my_struct).b = 10;

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?