0% found this document useful (0 votes)
31 views2 pages

Data Structures Csc211 Sessional 1

This document provides instructions for a data structures exam. It includes 5 questions asking students to explain why data structures are required, how to measure program efficiency, whether fast machines or algorithms are needed, and to write the output for two code snippets. Students are instructed to attempt all questions, provide concise answers, and that copying will result in a zero score. The exam is open book and all questions are worth equal marks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views2 pages

Data Structures Csc211 Sessional 1

This document provides instructions for a data structures exam. It includes 5 questions asking students to explain why data structures are required, how to measure program efficiency, whether fast machines or algorithms are needed, and to write the output for two code snippets. Students are instructed to attempt all questions, provide concise answers, and that copying will result in a zero score. The exam is open book and all questions are worth equal marks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

COMSATS Institute of Information Technology (Virtual Campus)

Subject: Data Structures CSC211


Sessional I (Spring 2016)
MARKS: 10

TIME: 01 Hour

INSTRUCTIONS:

Attempt all questions.

Write to the point answers, and all questions carry equal marks.

Its open book and if found copied, then straight ZERO will be given.

---------------------------------------------------------------------------------------------------------------------

1. Briefly explain in your own words that why data structures are required?

(2)

2. How we can measure the efficiency of a program?

(2)

3. Do we need fast machines or fast algorithms? Explain in your own words.

(2)

4. Write the output of the given program.

(2)

int foo [] = {1, 2, 2, 11, 21, 22, 32, 33, 43, 44, 45, 55};
int n, result=0;
int main ()
{
for ( n=0 ; n<10 ; ++n )
{
result += foo[n];
}
cout<<result;
return 0;
}

Page 1 of 2

5. Write the output of the given program.

(2)

void increment_all (int* start, int* stop)


{
int * current = start;
while (current != stop)
{
++(*current);
++current;
}
}
void print_all (const int* start, const int* stop)
{
const int * current = start;
while (current != stop)
{
cout<< *current << '\n';
++current;
}
}
int main ()
{
int numbers[] = {1,11,111};
increment_all (numbers,numbers+3);
print_all (numbers,numbers+3);
return 0;
}

--------------------------------------------------------------------------------------------------------------------Good Luck

Page 2 of 2

You might also like