msc f10 1st LAB DSA_new

msc f10 1st LAB DSA_new - DATE: 4 / 3 / 11 Data Structure...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
DATE: 4 / 3 / 11 M.Sc IT Lab 1 Note: Print every Array before and after modification. *Attempt at least two problems from Section A and two from section B in lab . Section A Problem 1: Print the sum of the numbers in the array. Except the number 13 which is very unlucky, so it does not count and numbers that come immediately after a 13 also do not count. Sample example: {1, 2, 2, 1} → 6 {1, 1} → 2 {1, 2, 2, 1, 13,1} → 6 {1, 2, 2, 1, 13, 675,1}→ 7 Problem 2: Given an array of integers, print “Good” if the array contains two consecutive 3’s and Print “Bad” otherwise. Sample example: {1, 3, 3} → Good {1, 3, 1, 3} → Bad {3, 1, 3} → Bad Problem 3: Given an array of integers, Print “Good” if the sum of all the 2's in the array is exactly 8 and print “Bad” otherwise. {2, 3, 2, 2, 4, 2}) → Good {2, 3, 2, 2, 4, 2, 2} → Bad Punjab University College of Information Technology.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Problem 4:
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

msc f10 1st LAB DSA_new - DATE: 4 / 3 / 11 Data Structure...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online