Search Header Logo

Data Structures Quiz

Authored by RAJAT GARG

Computers

University

Used 1+ times

Data Structures Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

50 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an abstract data type?

int

array

stack

pointer

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does malloc() return if it fails to allocate memory?

-1

NULL

0

void

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following allocates dynamic memory in C?

new

malloc

alloc

alloc_mem

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to allocate memory for an integer array of 5 elements?

int *arr = malloc(5);

int *arr = malloc(sizeof(int) * 5);

int arr[5];

int arr = malloc(5);

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which scenario best explains the use of pointers?

To swap values in a function

To print output

To increase array size

To declare constants

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why is dynamic memory allocation important?

Prevents function calls

Helps define memory at runtime

Improves syntax

Supports all data types

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which part of memory is used by dynamically allocated memory?

Stack

Heap

Code

Data

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