
Data Structure

Quiz
•
Professional Development
•
4th Grade
•
Hard
K Indira
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Choose the Application
Stack
Queue
List ADT
List
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include <stdio.h>
int main()
{
int arr[] = {1,2,3,4,5};
printf("arr [0] is %d", arr[0]);
// arr[10] is out of bound
printf("arr[10] is %d", arr[10]);
return 0;
}
Error
arr [0] is 1
arr[10] is -1786647872
arr [0] is 1
arr[10] is -1786647872
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include <stdio.h>
int main()
{
int arr[] = {1,2,3,4,5};
printf("arr [0] is %d",arr[0]);
printf("arr[10] is %d",arr[10]);
// allocation memory to out of bound
// element
arr[10] = 11;
printf("arr[10] is %d",arr[10]);
return 0;
}
Segmentation Fault (SIGSEGV)
Output will be displayed
Compiler Error
None of the above
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Predict the ourput:
printf("Enter the value to insert\n");
scanf("%d", &value);
for (c = n - 1; c >= position - 1; c--)
array[c+1] = array[c];//Moving to Next Position
array[position-1] = value;//Array Index
printf("Resultant array is\n");
for (c = 0; c <= n; c++)
printf("%d\n", array[c]);
return 0;
insert an element in an Array
delete an element in an Array
insert an element in the middle
delete an element in the middle
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
scanf("%d", &position);
if(position >= n+1)
printf("\n\nDeletion not possible\n\n");
else
// updating the locations with next elements
for(c = position-1; c < n-1; c++)
array[c] = array[c+1];
printf("\n\nResultant array is: ");
/*
the array size gets reduced by 1
after deletion of the element
*/
for(c = 0; c < n-1; c++)
printf("%d ", array[c]);
printf("\n\n\t\t\tCoding is Fun !\n\n\n");
Delete an Element from Array
Insert an Element from Array
Insert an Element from Array in the middle
Delete an Element from Array in the middle
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
{
if(p!=0)
{
int elt,flag=0;
printf("Enter the element to search in the List");
scanf("%d",&elt);
for(int i=0;i<p;i++)
{
if(L[i]==elt)
{
printf("The %d is available at %d ", elt, i);
flag=1;
}
}
if(flag==0)
{
printf("Element not found in the list");
}
}
else
{
printf("The List is empty");
}
}
Insert the Element
Delete the Element
Find the Element
Insert the Element at Last
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
if(isStackFull())
printf("Unable to %d as the Stack Is Full\n",val);
else
{
//increment top by 1
++top;
arr[top]=val;
}
PUSH
POP
Middle element
none of the these
Create a free account and access millions of resources
Similar Resources on Wayground
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Professional Development
20 questions
Place Value

Quiz
•
4th Grade
18 questions
Subject and Predicate Practice

Quiz
•
4th Grade
5 questions
Remembering 9/11 Patriot Day

Lesson
•
3rd - 5th Grade
20 questions
Run-On Sentences and Sentence Fragments

Quiz
•
3rd - 6th Grade
20 questions
4 Types of Sentences

Quiz
•
3rd - 5th Grade
20 questions
place value

Quiz
•
4th Grade
20 questions
Place Value and Rounding

Quiz
•
4th Grade
15 questions
Place Value

Quiz
•
4th Grade