Saturday 28 February 2015

Question 1: Create a web site for a School consisting of the following pages:
a) The Home page should consists of four areas containing the following information:
  • Header area containing the logo, name of the school and a photograph of the school. Make sure that you use a good picture format.
  • Left area containing the links to other pages – these links should include -
  • About us, Academics, Infrastructure, Contact us and Feedback.
  • The Content area should display a table showing list of upcoming events of the School along with dates.
  • The Footer area should display the copyright information and current date and time.
Note:- You need to make sure that the Header and Footer area is same across all the pages of the website.
b) About us page should give information about the Objectives, values and beliefs of the school, preferable in some structured format. You may use lists or tables for the same.
c) Academics page lists details about the teachers and the past activities of the school.
d) Infrastructure page should highlighting the available resources of the school.
e) Contact us page should provide information about the school address and contact details
f) Feedback page should have a feedback form consisting of text box, radio buttons, list boxes etc. This page should get the information from the site visitors about various aspects of schools website. You must use JavaScript to check that all the required fields are entered by the visitor.
g) Write a program using VBscipt that adds only diagonal elements of two matrices. The program should be efficient.
Solution: a web site for a School
a)
<code>
< HTML>
< frameset rows=”21%,*” >
< frame name=”topframe” src=”header.html” frameborder=”0″ scrolling=”no”/ >
< frameset rows=”83%,*” >
< frameset cols=”15%,*” >
< frame name=”left” src=”links.html” frameborder=”0″ scrolling=”no”/ >
< frame name=”centre” src=”home.html” frameborder=”0″/ >
</ frameset >
< frame name=”lowerframe” src=”footer.html” frameborder=”0″ scrolling=”no”/ >
</ frameset >
</ frameset >
</ HTML>
</code>

For Header Area:   Header.html
<code>
<html>
<head>
<title>MCSL 016 Assignment</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<style type=”text/css”>
.style2 {
font-size: 12px;
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #00CC00;
}
.style4 {font-size: 10px; color: #000000; }
.style5 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style6 {
font-size: 27px;
color: #FF0000;
}
.style10 {font-size: 10px; color: #9933FF; }
body {
background-color: #333333;
}
</style>
</head>
<body>
<table align=”left”>
<tr>
<td> <img src=”logo.jpg” alt=”logo” width=”80px” height=”80px”/>
<td>
Indian Education Society’s
NEW ENGLISH SCHOOL
Govt Colony, Bandra (E)
MUMBAi- 400051
</td>
<td> <img src=”logo.jpg” alt=”logo” width=”80px” height=”80px”/>
</tr>
<tr>
</table>
<table align=”right”>
<td> <img src=”school.jpeg” width=”400px” height=”80px”/> </td>
</td>
<tr>
<td>  Quick Links :
<select name=”ddlist”>
<option> Home</option>
<option> About Us</option>
<option> Academics</option>
<option> Infrastructure</option>
<option> Contact Us</option>
<option> Feedback</option>
</select> </td>
</tr>
</tr>
</table>
</body>
</html>
</code>
For Left Area:  Links.html
<code>
<HTML >
<HEAD >
<TITLE > </TITLE >
<BODY bgcolor=”lightblue” >
<table align=”left” >
<tr > <td > </td ></tr >
<tr >
<td > <a href=”home.html” target=”centre” > Home</a > </td >
</tr >
<tr > <td > </td ></tr >
<tr >
<td > <a href=”about.html” target=”centre” > About us</a > </td >
</tr >
<tr > <td > </td ></tr >
<tr >
<td > <a href=”academic.html” target=”centre” > Academics</a > </td >
</tr >
<tr > <td > </td ></tr >
<tr >
<td > <a href=”infra.html” target=”centre” > Infrastructure</a > </td >
</tr >
<tr > <td > </td ></tr >
<tr >
<td > <a href=”contact.html” target=”centre” > Contact us</a > </td >
</tr >
<tr > <td > </td ></tr >
<tr >
<td > <a href=”feedback.html” target=”centre” > Feedback</a > </td >
</tr >
</table >
</BODY >
</HTML >
</code>
For Content Area:  Home.html
<code>
<HTML >
<HEAD >
<TITLE > New Document </TITLE >
</HEAD >
<BODY bgcolor=”lightgreen” >
Home Page
<center > <h1 > <u > Welcome To New English School Website</u > </h1 > <center >
<table align=”center” >
<tr >
<tr > <img src=”big_school.jpg” alt=”Image” width=”500px” height=”250px”/ > </td >
</tr >
</table >
<table width=”737″ border=”0″>
<table width=”100%” border=”0″ align=”right” cellpadding=”0″ cellspacing=”0″>
<tr>
<td><p align=”center”><strong><u>UPCOMING EVENTS</u><br><br>EXAMINATION SCHEDULE FOR HALF-YEARLY EXAMINATION<br>
</strong><strong>Aug 2014 </strong></p>
<table align=”center” width=”571″ border=”1″>
<tr>
<td width=”70″><div align=”center”>
<div align=”center”>Class/Date</div>
</div></td>
<td width=”45″><div align=”center”> 1 </div></td>
<td width=”46″><div align=”center”> 4 </div></td>
<td width=”47″><div align=”center”> 7 </div></td>
<td width=”53″><div align=”center”> 10 </div></td>
<td width=”50″><div align=”center”><span class=”style28″>13 </div></td>
<td width=”52″><div align=”center”><span class=”style28″>16 </div></td>
<td width=”48″><div align=”center”> 19 </div></td>
<td width=”51″><div align=”center”><span class=”style28″>22 </div></td>
<td width=”45″><div align=”center”><span class=”style28″>25 </div></td>
</tr>
<tr>
<td><div align=”center”>
<div align=”center”><strong>I</strong></div>
</div></td>
<td><div align=”center”><span class=”style18″>Bengali </div></td>
<td><div align=”center”><span class=”style18″>English </div></td>
<td><div align=”center”><span class=”style18″>Maths </div></td>
<td><div align=”center”><span class=”style18″>Drawing </div></td>
<td><div align=”center”><span class=”style18″>Science </div></td>
<td><div align=”center”> Work Edn  </div></td>
<td><div align=”center”> Phy. Edn  </div></td>
<td><div align=”center”> * </div></td>
<td><div align=”center”> * </div></td>
</tr>
<tr>
<td><div align=”center”>
<div align=”center”><strong>II</strong></div>
</div></td>
<td><div align=”center”><span class=”style18″>Maths </div></td>
<td><div align=”center”><span class=”style18″>English </div></td>
<td><div align=”center”> Science </div></td>
<td><div align=”center”><span class=”style18″>Bengali </div></td>
<td><div align=”center”>  </div></td>
<td><div align=”center”> Phy. Edn </div></td>
<td><div align=”center”> * </div></td>
<td><div align=”center”> Work Edn </div></td>
<td><div align=”center”> * </div></td>
</tr>
<tr>
<td><div align=”center”>
<div align=”center”><strong>III</strong></div>
</div></td>
<td><div align=”center”> * </div></td>
<td><div align=”center”><span class=”style18″>Maths </div></td>
<td><div align=”center”><span class=”style18″>Science </div></td>
<td><div align=”center”><span class=”style18″>English </div></td>
<td><div align=”center”><span class=”style18″>Bengali </div></td>
<td><div align=”center”> * </div></td>
<td><div align=”center”> Phy. Edn </div></td>
<td><div align=”center”> * </div></td>
<td><div align=”center”> Work Edn </div></td>
</tr>
<tr>
<td><div align=”center”>
<div align=”center”><strong>IV</strong></div>
</div></td>
<td><div align=”center”> Phy. Edn </div></td>
<td><div align=”center”> * </div></td>
<td><div align=”center”><span>English </div></td>
<td><div align=”center”> * </div></td>
<td><div align=”center”><span class=”style18″>Maths </div></td>
<td><div align=”center”><span class=”style18″>Bengali </div></td>
<td><div align=”center”><span class=”style18″>Science </div></td>
<td><div align=”center”> * </div></td>
<td><div align=”center”> Work Edn </div></td>
</tr>
<tr>
<td><div align=”center”>
<div align=”center”><strong>V</strong></div>
</div></td>
<td><div align=”center”><span class=”style18″>Science </div></td>
<td><div align=”center”> Work Edn </div></td>
<td><div align=”center”> * </div></td>
<td><div align=”center”><span class=”style18″>Bengali </div></td>
<td><div align=”center”> * </div></td>
<td><div align=”center”><span class=”style18″>English </div></td>
<td><div align=”center”> Phy. Edn </div></td>
<td><div align=”center”><span class=”style18″>Maths </div></td>
<td><div align=”center”> * </div></td>
</tr>
<tr>
<td><div align=”center”>
<div align=”center”><strong>VI</strong></div>
</div></td>
<td><div align=”center”> * </div></td>
<td><div align=”center”><span class=”style18″>Maths </div></td>
<td><div align=”center”><span class=”style18″>Science </div></td>
<td><div align=”center”> Phy. Edn </div></td>
<td><div align=”center”><span class=”style18″>Bengali </div></td>
<td><div align=”center”><span class=”style18″>History </div></td>
<td><div align=”center”><span class=”style18″>English </div></td>
<td><div align=”center”><span class=”style18″>Biology </div></td>
<td><div align=”center”> Work Edn </div></td>
</tr>
<tr>
<td><div align=”center”>
<div align=”center”><strong>VII</strong></div>
</div></td>
<td><div align=”center”> Phy. Edn </div></td>
<td><div align=”center”><span class=”style18″>Physics </div></td>
<td><div align=”center”><span class=”style18″>Bengali </div></td>
<td><div align=”center”><span class=”style18″>Chem </div></td>
<td><div align=”center”><span class=”style18″>Maths </div></td>
<td><div align=”center”> Work Edn </div></td>
<td><div align=”center”> Economics </div></td>
<td><div align=”center”><span class=”style18″>English </div></td>
<td><div align=”center”><span class=”style18″>History </div></td>
</tr>
<tr>
<td><div align=”center”>
<div align=”center”><strong>VIII</strong></div>
</div></td>
<td><div align=”center”><span class=”style18″>Socio </div></td>
<td><div align=”center”> Phy. Edn </div></td>
<td><div align=”center”><span class=”style18″>Maths </div></td>
<td><div align=”center”> Work Edn </div></td>
<td><div align=”center”><span class=”style18″>Physics </div></td>
<td><div align=”center”><span class=”style18″>Chem </div></td>
<td><div align=”center”><span class=”style18″>Bengali </div></td>
<td><div align=”center”><span class=”style18″>Economics </div></td>
<td><div align=”center”><span class=”style18″>English </div></td>
</tr>
<tr>
<td><div align=”center”>
<div align=”center”><strong>IX</strong></div>
</div></td>
<td><div align=”center”><span class=”style18″>Biology </div></td>
<td><div align=”center”> Work Edn </div></td>
<td><div align=”center”><span class=”style18″>History </div></td>
<td><div align=”center”><span class=”style18″>Chem </div></td>
<td><div align=”center”><span class=”style18″>Maths </div></td>
<td><div align=”center”> Bengali </div></td>
<td><div align=”center”> Phy. Edn </div></td>
<td><div align=”center”><span>English </div></td>
<td><div align=”center”><span class=”style18″>Physics </div></td>
</tr>
<tr>
<td><div align=”center”>
<div align=”center”><strong>X</strong></div>
</div></td>
<td><div align=”center”><span class=”style18″>Biology </div></td>
<td><div align=”center”><span class=”style18″>Economics </div></td>
<td><div align=”center”> Work Edn </div></td>
<td><div align=”center”><span class=”style18″>Bengali </div></td>
<td><div align=”center”><span class=”style18″>Maths </div></td>
<td><div align=”center”><span class=”style18″>Physics </div></td>
<td><div align=”center”><span class=”style18″>English </div></td>
<td><div align=”center”> Phy. Edn </div></td>
<td><div align=”center”> Biology </div></td>
</tr>
<tr>
<td><div align=”center”>
<div align=”center”><strong>XI</strong></div>
</div></td>
<td><div align=”center”><span class=”style18″>Chem </div></td>
<td><div align=”center”><span class=”style18″>Economics </div></td>
<td><div align=”center”><span class=”style18″>Bengali </div></td>
<td><div align=”center”><span class=”style18″>Biology </div></td>
<td><div align=”center”><span class=”style18″>Socio </div></td>
<td><div align=”center”><span class=”style18″>English </div></td>
<td><div align=”center”><span class=”style18″>Statistics </div></td>
<td><div align=”center”><span class=”style18″>Maths </div></td>
<td><div align=”center”><span class=”style18″>Physics </div></td>
</tr>
<tr>
<td><div align=”center”>
<div align=”center”><strong>XII</strong></div>
</div></td>
<td><div align=”center”><span class=”style18″>Bengali </div></td>
<td><div align=”center”><span class=”style18″>Biology </div></td>
<td><div align=”center”><span class=”style18″>Socio </div></td>
<td><div align=”center”><span class=”style18″>Maths </div></td>
<td><div align=”center”><span class=”style18″>English </div></td>
<td><div align=”center”><span class=”style18″>Statistics </div></td>
<td><div align=”center”><span class=”style18″>Physics </div></td>
<td><div align=”center”><span class=”style18″>Economics </div></td>
<td><div align=”center”><span class=”style18″>Chem </div></td>
</tr>
</table>
</BODY >
</HTML >
</code>
For Footer Area:  <strong>Footer.html</strong>
<code>
<HTML >
<HEAD >
<TITLE > New Document </TITLE >
</HEAD >
<script language=”vbscript” >
sub getCurrentDateTime()
dim daydate,daytime
daydate=FormatDateTime(Date(),1)
dtime=Hour(Now)
document.form1.txtdatetime.value=CStr(daydate)+” “+CStr(Time)
end sub
</script>
<BODY bgcolor=”lightblue” onLoad=”getCurrentDateTime()” >
<form name=”form1″ onLoad=”getCurrentDateTime()” >
<p><center><u>ALL RIGHT RESERVED.</u><center >
Copyright @ 2014, New English School, Bandra. <br />
<table>
<tr> </tr>
<tr> <td> Current Date &amp; Time:</td> <td> <input type=”text” name=”txtdatetime” size=”30″ /> </td> <td> </td>
<tr> </tr>
</table>
<strong><a href=”home.html”>Home</a> / <a href=”about.html”>About Us</a> / <a href=”academic.html”>Academics</a> / <a href=”infra.html”>Infrastucture</a>/ <a href=”contact.html”>Contact Us</a> </strong></p>
</form>
</BODY >
</HTML >
</code>
b)About us page should give information about the Objectives, values and beliefs of the school, preferable in some structured format. You may use lists or tables for the same.
For About Us Page:  About.html
<code>
<html>
<head>
<title>IES New English School, Bandra , Mumbai</title>
</head>
<body bgcolor=”lightgreen” >
About us Page
<div>
<h1>ABOUT US</h1>
<table width=”581″ border=”0″>
<tr>
<td width=”700″><table width=”550″ border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″>
<tbody>
<tr>
<th height=”117″ scope=”col”><p align=”center”>Indian Education Society</p>
<p align=”justify”>The Indian Education Society was founded in 1912 by a tiny band of young and dedicated College teachers who gave the best years of their lives to the society and its Colleges. They were S.V. Nabar, B.N. Vaidya, V.N.SuIe, P.Y. Patkar and |M.D.Harne. The little seed these stalwarts sowed grew into a mighty tree with several branches, Colleges and colleges. In the later period, the Indian Education Society was served brilliantly by Manik Lotlikar and Padmakar Dhamdhere. Undertheir care and tutelage the society developed into an institution managing over sixty Colleges, a junior college and two professional colleges – a College of Management and a College of Architecture. The Colleges of the I.E.S. have been a nursery out of which have blossomed enormous number of persons with varied talents. Its Colleges have produced some of the leading scientists and researchers, scholars and teachers, engineers and doctors, brave members of the armed forces, cricketers and swimmers, theatre and film personalities as well as the first Indian idol! The Indian Education Society is committed to serve the community with the best kind of education. It has taken innovative steps in the field of education like e – learning, encouragement of technical education at the College level, digitalizing of libraries, introduction of new streams like the ICSE, etc. The Society has also initiated the process of accreditation of its Colleges by the Quality Council of India begining with the NES Campus in Bandra East. In establishing a junior college the IES affirms that it would provide the best facilities and resources to its students. In keeping with the high standard the IES has maintained in the past, we hope to have a junior college which would become soon the first choice of our students. The Indian Education Society believes that in cooperation with the heads of our institutions and teachers and parents / guardians and students, we can scale still greater heights of excellence and educate our young to become worthy citizens of our country.</p>
<div align=”left”>
<p> </p>
<table width=”377″ height=”12″ border=”0″ cellpadding=”0″ cellspacing=”0″>
<tbody>
<tr>
<td valign=”top”> </td>
<td colspan=”2″ valign=”top”><p>Indian Education Society <br />
Raja Shivaji Vidyasankul, Hindu Colony, Dadar, <br />
Mumbai 400 014. Tel. N0. 6137 9595</p>
<p>Governing Council</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>A. B. Vaidya</p></td>
<td width=”323″ valign=”top”><p>President</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>Manohar D. Lotlikar</p></td>
<td width=”323″ valign=”top”><p>Vice President and Chief Executive Officer</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>Amol P. Dhamdhere</p></td>
<td width=”323″ valign=”top”><p>Vice President</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>Achala Joshi</p></td>
<td width=”323″ valign=”top”><p>Trustee</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>Satish M. Lotlikar</p></td>
<td width=”323″ valign=”top”><p>Trustee</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>Satish R. Nayak</p></td>
<td width=”323″ valign=”top”><p>Trustee</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>Shailendra V. Gharse</p></td>
<td width=”323″ valign=”top”><p>Member</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>V. K. Sinha</p></td>
<td width=”323″ valign=”top”><p>Member</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>Meenal Mohadikar</p></td>
<td width=”323″ valign=”top”><p>Member</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>Suhas G. Rege</p></td>
<td width=”323″ valign=”top”><p>Member</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>Shaunak Satpute</p></td>
<td width=”323″ valign=”top”><p>Member</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>Gajanan Samant</p></td>
<td width=”323″ valign=”top”><p>Member</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>Sagar Sule</p></td>
<td width=”323″ valign=”top”><p>Member</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>Rajeev Joshi</p></td>
<td width=”323″ valign=”top”><p>Member</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>Geetanjali Desai</p></td>
<td width=”323″ valign=”top”><p>Heads’ Representative</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>Vaishali K. More</p></td>
<td width=”323″ valign=”top”><p>Supervisors’ Representative</p></td>
</tr>
<tr>
<td width=”119″ valign=”top”> </td>
<td width=”201″ valign=”top”><p>Rajani Mhaisalkar</p></td>
<td width=”323″ valign=”top”><p>Teachers’ Representative</p></td>
</tr>
</tbody>
</table>
</div>
<blockquote>
<p align=”left”><strong>INDIAN EDUCATION SOCIETY<br />
New English School </strong><br />
</p>
<p align=”left”> V. K. Sinha <strong>Chairman</strong></p>
<p align=”left”> Amol Dhamdhere</p>
<p align=”left”> Satish R. Nayak</p>
<p align=”left”> Gajanan V. Samant</p>
<p align=”left”> Shailendra V. Gharse</p>
<p align=”left”> Vikram Karandikar</p>
<p align=”left”> Lakshmi Jayakar</p>
<p align=”left”>Dr. Mulwad Vinata</p>
<p align=”left”>Bharati M. Hajari <strong>Convenor</strong></p>
<p align=”left”><br />
INDIAN EDUCATION SOCIETY<br />
New English School
</p>
<p align=”left”>Government Servants Colony, Near Kherwadi Police Station,<br />
Bandra ( E) , Mumbai 400051.</p>
</blockquote>
<p align=”left”> </p>
<p>V. K. Sinha Bharati M. Hajari</p>
<p>Chairman Principal</p>
</th>
</tr>
</tbody>
</table>
<br /></td>
</tr>
</table>
<p>&amp;nbsp;</p>
</div>
</body>
</html>
</code>
c)Academics page lists details about the teachers and the past activities of the school.
For Academics Page:  Academic.html
<code>
<html><head> <title>IES New English School, Bandra , Mumbai</title> </head> <body bgcolor=”lightgreen” > Academic’s Page <div> <h1>Academic </h1> <table width=”596″ border=”0″> <tr> <td width=”590″><table width=”539″ height=”47″ border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″> <tbody> <tr> <th width=”520″ height=”45″ scope=”col”><p align=”left”>    <span class=”style23″>Admission-  <br /> <br /> 1] Admission is open to all irrespective caste, creed and religion.<br /> 2] Applications are available in the office<br /> 3] The necessary documents such as L.C, latest progress report from the previous school etc. should be attached with the form.<br /> 4] Admissions will be confirmed only after the interview of the student and payment of fees.    </p> </th> </tr> </tbody> </table> <p align=”center”><strong><u>ACHIEVEMENTS IN SPORTS</u></strong></p> <div align=”center”> <table border=”1″ cellspacing=”0″ cellpadding=”0″ align=”left”> <tr> <td width=”81″ valign=”top”><br /> Year </td> <td width=”111″ valign=”top”><p>Competition</p></td> <td width=”115″ valign=”top”><p>Organizer</p></td> <td width=”234″ valign=”top”><p>Result</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>2009</p></td> <td width=”111″ valign=”top”><p>Carrom</p></td> <td width=”115″ valign=”top”><p>District Krida Adhikari</p></td> <td width=”234″ valign=”top”><p>Kadam Sheyas- I Prize &amp;amp; gold medal<br /> Gaddam Neha-II Prize &amp;amp; silver medal<br /> The school received Runner Up award and bagged a Trophy</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Cricket</p></td> <td width=”115″ valign=”top”><p>Khichadiya</p></td> <td width=”234″ valign=”top”><p>Runner Up Award</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”115″ valign=”top”><p>Air India</p></td> <td width=”234″ valign=”top”><p>Runner Up Award</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”115″ valign=”top”><p>I. E. S</p></td> <td width=”234″ valign=”top”><p>Won final and received a Trophy<br /> Pawar Dipesh declared the best player and received a gold medal</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Kho-Kho</p></td> <td width=”115″ valign=”top”><p>Mumbai Sports</p></td> <td width=”234″ valign=”top”><p>Won the final</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>2010</p></td> <td width=”111″ valign=”top”><p> Kabaddi</p></td> <td width=”115″ valign=”top”><p>Vand Mataram Foundation</p></td> <td width=”234″ valign=”top”><p>I Prize &amp;amp; Trophy</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Kho-Kho</p></td> <td width=”115″ valign=”top”><p>I.E.S</p></td> <td width=”234″ valign=”top”><p>Trophy</p></td> </tr> <tr> <td width=”81″ valign=”top”><p> </p></td> <td width=”111″ valign=”top”><p>Cricket (Vinu Mankad)</p></td> <td width=”115″ valign=”top”><p>District Krida Adhikari</p></td> <td width=”234″ valign=”top”><p>Runner Up Award</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Carrom</p></td> <td width=”115″ valign=”top”><p>I.E.S</p></td> <td width=”234″ valign=”top”><p>Acharya Raj- I Prize and Gold medal<br /> Kale Mayuri- I Prize &amp;amp; Gold medal</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Chess</p></td> <td width=”115″ valign=”top”><p>I.E.S</p></td> <td width=”234″ valign=”top”><p> Chaudary Vaibhavi- I Prize &amp;amp; Gold medal</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>2011</p></td> <td width=”111″ valign=”top”><p>Disrict level cricket </p></td> <td width=”115″ valign=”top”><p>District Krida Adhikari</p></td> <td width=”234″ valign=”top”><p>Runner Up Award</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Carrom</p></td> <td width=”115″ valign=”top”><p>Bombay Arts &amp;amp; Sports</p></td> <td width=”234″ valign=”top”><p>Gaddam Neha, Kadam Shreyas, Malla Adarsh<br /> &amp;amp; Sawant Sail<br /> Reveived I Prize</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Chess</p></td> <td width=”115″ valign=”top”><p>Bombay Arts &amp;amp; Sports</p></td> <td width=”234″ valign=”top”><p>Dicholkar Diti<br /> &amp;amp; Pol Prathmesh received I Prize</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”115″ valign=”top”><p>I.E.S</p></td> <td width=”234″ valign=”top”><p>Malla Adarsh- I Prize and Gold medal</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>75m Running</p></td> <td width=”115″ valign=”top”><p> M.S.B Scout &amp;amp; Guide</p></td> <td width=”234″ valign=”top”><p>Haldankar Anushka &amp;amp; Pal Suraj- I Prize</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Langadi</p></td> <td width=”115″ valign=”top”><p> —-“——</p></td> <td width=”234″ valign=”top”><p>Kadam Tejal &amp;amp; Kadam Sahil- I Prize</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>2012</p></td> <td width=”111″ valign=”top”><p>Carrom</p></td> <td width=”115″ valign=”top”><p>Care Foundation</p></td> <td width=”234″ valign=”top”><p>Gaddam Neha,Malla Adarsh,Kadam Prathmesh received gold medals</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”115″ valign=”top”><p>Mumbai Sports</p></td> <td width=”234″ valign=”top”><p>Gaddam Neha-Gold medal</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Chess</p></td> <td width=”115″ valign=”top”><p>I.E.S</p></td> <td width=”234″ valign=”top”><p>Chaudhary Vaibhavi- Gold medal &amp;amp; Trophy</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Gymnastics VT</p></td> <td width=”115″ valign=”top”><p>I.E.S</p></td> <td width=”234″ valign=”top”><p>Walavalkar Yash- Gold medal</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>400 m Running</p></td> <td width=”115″ valign=”top”><p>I.E.S</p></td> <td width=”234″ valign=”top”><p>Inpure Tanvi- I Prize</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Long Jump</p></td> <td width=”115″ valign=”top”><p>—-“—-</p></td> <td width=”234″ valign=”top”><p>Yadav Ashutosh- I Prize</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Shot Put</p></td> <td width=”115″ valign=”top”><p>——“—–</p></td> <td width=”234″ valign=”top”><p>Chaudhari Pratik-I Prize</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Carrom</p></td> <td width=”115″ valign=”top”><p>I.E.S</p></td> <td width=”234″ valign=”top”><p>The school received ‘Nirgudkar Foundation Trophy’</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Madhav Mantri Cricket Tournament</p></td> <td width=”115″ valign=”top”><p>I.E.S</p></td> <td width=”234″ valign=”top”><p>The school received ‘Late Dr. Harish Ram Nayak Rotating Trophy’</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Kho-Kho</p></td> <td width=”115″ valign=”top”><p>I.E.S</p></td> <td width=”234″ valign=”top”><p>Won finals and received a Trophy</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Cricket</p></td> <td width=”115″ valign=”top”><p>District Krida Adhikari</p></td> <td width=”234″ valign=”top”><p>Runner Up Award</p></td> </tr> <tr> <td width=”81″ valign=”top”><p> </p></td> <td width=”111″ valign=”top”><p>Foot Ball</p></td> <td width=”115″ valign=”top”><p>I.E.S</p></td> <td width=”234″ valign=”top”><p>Runner Up Award</p></td> </tr> <tr> <td width=”81″ valign=”top”><p>&amp;nbsp;</p></td> <td width=”111″ valign=”top”><p>Lazim</p></td> <td width=”115″ valign=”top”><p>Sahashaley Upakram</p></td> <td width=”234″ valign=”top”><p>I Prize</p></td> </tr> </table> <br /></td> </tr> </table> <p>&amp;nbsp;</p> </div> </ body > </ html ></code>
d) Infrastructure page should highlighting the available resources of the school.
For Infrastructure Page:  Infra.html
<code>
<html><head> <title>IES New English School, Bandra , Mumbai</title> </head> <body bgcolor=”lightgreen” > Infrastructure Page <div> <h1>Infrastructure </h1> <table width=”596″ border=”0″> <tr> <td width=”590″><table width=”539″ height=”47″ border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″> <tbody> <tr> <th width=”520″ height=”45″ scope=”col”><p align=”left”>     Admission-  <br /> <br /> 1] Admission is open to all irrespective caste, creed and religion.<br /> 2] Applications are available in the office<br /> 3] The necessary documents such as L.C, latest progress report from the previous school etc. should be attached with the form.<br /> 4] Admissions will be confirmed only after the interview of the student and payment of fees.    </p> <p align=”left”> <strong>Facilities</strong>-  <br /> <br /> 1] well lighted and ventilated classrooms<br /> <br /> 2] A computer Lab with individual computer for every student<br /> <br /> 3] Well equipped Laboratories for Physics, Chemistry and Biology<br /> <br /> 4] Audio-Visual room<br /> <br /> 5] Library with treasure of books<br /> <br /> 6] Specious play ground<br /> <br /> 7] Auditorium with well equipped technology<br /> <br /> 8] A healthy canteen service<br /> <br /> 9] Arts and Spots Academy with well experienced coaches<br /> <br /> 10] Art room for showing creativity?<br /> <br /> 11] Introduction of new subjects- <br /> a] Technical with equipped lab <br /> b] V.G [Vocational Guidance] with expert councilors.<br /> <br /> 12] Well qualified staff<br /> <br /> 13] Personal attention <a name=”_GoBack” id=”_GoBack”></a></p></th> </tr> </tbody> </table> <br /></td> </tr> </table> <p>&amp;nbsp;</p> </div> </body> </html></code>
e) Contact us page should provide information about the school address and contact details.
For Contact Us Page:  Contact.html
<code>
<HTML >
<HEAD >
<TITLE > New Document </TITLE >
</HEAD >
<BODY bgcolor=”lightgreen” >
Contact Page
<center > <h1 > <u > Contact Us</u > </h1 > <center >
<table align=”center” >
<tr >
<tr > <img src=”contact.jpg” alt=”Image” width=”600px” height=”350px”/ > </td >
</tr >
</table >
</BODY >
</HTML >
</code>
f ) Feedback page should have a feedback form consisting of text box, radio buttons, list boxes etc. This page should get the information from the site visitors about various aspects of schools website. You must use JavaScript to check that all the required fields are entered by the visitor.
For Feedback Page:  <strong>Feedback.html</strong>
<code>
<html>
<head>
<title>Feedback form</title>
</head>
<body bgcolor=”lightgreen” >
Feedback Page
<h1>Website feedback form</h1>
<div>
<div><div><div class=”field-item even” property=”content:encoded”><p>Our website was recently redesigned. Please let us know how we can improve your experience by filling in this form.</p>
</div></div></div><div><div><div class=”field-item even”><p><strong>Information and privacy:</strong></p></div></div></div><form enctype=”multipart/form-data” action=”/school-environment-enterprise-development/website-feedback-form” method=”post” id=”webform-client-form-236″ accept-charset=”UTF-8″><div><div>
<label for=”edit-submitted-name”>First name </label>
<input type=”text” id=”edit-submitted-name” name=”submitted[name]” value=”" size=”60″ maxlength=”128″ />
</div>
<div>
<label for=”edit-submitted-last-name”>Last name </label>
<input type=”text” id=”edit-submitted-last-name” name=”submitted[last_name]” value=”" size=”60″ maxlength=”128″ />
</div>
<div>
<label for=”edit-submitted-email”>Email </label>
<input type=”email” id=”edit-submitted-email” name=”submitted[email]” size=”60″ />
</div>
<div>
<div>
<div>
<label for=”edit-submitted-who-are-you-select”>Who are you? <abbr title=”This field is required.”>*  (required) </abbr> </label>
<select id=”edit-submitted-who-are-you-select” name=”submitted[who_are_you][select]“><option value=”" selected=”selected”>- Select -</option><option value=”1″>Prospective student</option><option value=”2″>Undergrad student</option><option value=”3″>Graduate student</option><option value=”4″>Staff</option><option value=”5″>Faculty</option><option value=”6″>Alumni</option><option value=”select_or_other”>Other…</option></select>
</div>
<div>
<label for=”edit-submitted-who-are-you-other”>Who are you? Other… </label>
<input type=”text” id=”edit-submitted-who-are-you-other” name=”submitted[who_are_you][other]” value=”" size=”60″ maxlength=”128″ />
</div>
</div>
</div>
<input type=”hidden” name=”details[sid]” />
<input type=”hidden” name=”details[page_num]” value=”1″ />
<input type=”hidden” name=”details[page_count]” value=”1″ />
<input type=”hidden” name=”details[finished]” value=”0″ />
<input type=”hidden” name=”form_build_id” value=”form-qjLa24rqko-g3tMMntC-5NRTPS4SnDNwWsDBT9KOaJY” />
<input type=”hidden” name=”form_id” value=”webform_client_form_236″ />
<div class=’jfhtml’><p> <strong>What is your opinion of the site? </p> <p> Please rate the following aspects </p></div>
<div class=’error-message’ id=’hdeb2_2453_error’></div>
<fieldset class=’jfradio’ id=’hdeb2_2453′>
<div class=’control-group’>
<legend id=”hdeb2_2453_label”>Look and feel</legend>
<div class=’controls’>
<label class=’radio’ for=’hdeb2_2453_0′>
<input checked=checked value=’Good’ id=’hdeb2_2453_0′ name=’hdeb2′ type=’radio’ />
Good
</label>
<label class=’radio’ for=’hdeb2_2453_1′>
<input value=’Average’ id=’hdeb2_2453_1′ name=’hdeb2′ type=’radio’ />
Average
</label>
<label class=’radio’ for=’hdeb2_2453_2′>
<input value=’Poor’ id=’hdeb2_2453_2′ name=’hdeb2′ type=’radio’ />
Poor
</label>
<span class=’help-block’ id=’hdeb2_2453_error’>
</div>
</div>
</fieldset>
<div></div>
<div class=’error-message’ id=’h5e77_2454_error’></div>
<fieldset class=’jfradio’ id=’h5e77_2454′>
<div class=’control-group’>
<legend id=”h5e77_2454_label”>Ease of use</legend>
<div class=’controls’>
<label class=’radio’ for=’h5e77_2454_0′>
<input checked=checked value=’Good’ id=’h5e77_2454_0′ name=’h5e77′ type=’radio’ />
Good
</label>
<label class=’radio’ for=’h5e77_2454_1′>
<input value=’Average’ id=’h5e77_2454_1′ name=’h5e77′ type=’radio’ />
Average
</label>
<label class=’radio’ for=’h5e77_2454_2′>
<input value=’Poor’ id=’h5e77_2454_2′ name=’h5e77′ type=’radio’ />
Poor
</label>
<span class=’help-block’ id=’h5e77_2454_error’>
</div>
</div>
</fieldset>
<div></div>
<div class=’error-message’ id=’h99b4_2455_error’></div>
<fieldset class=’jfradio’ id=’h99b4_2455′>
<div class=’control-group’>
<legend id=”h99b4_2455_label”>Searching facilities</legend>
<div class=’controls’>
<label class=’radio’ for=’h99b4_2455_0′>
<input checked=checked value=’Good’ id=’h99b4_2455_0′ name=’h99b4′ type=’radio’ />
Good
</label>
<label class=’radio’ for=’h99b4_2455_1′>
<input value=’Average’ id=’h99b4_2455_1′ name=’h99b4′ type=’radio’ />
Average
</label>
<label class=’radio’ for=’h99b4_2455_2′>
<input value=’Poor’ id=’h99b4_2455_2′ name=’h99b4′ type=’radio’ />
Poor
</label>
<span class=’help-block’ id=’h99b4_2455_error’>
</div>
</div>
</fieldset>
<div></div>
<div class=’error-message’ id=’h94b8_2456_error’></div>
<fieldset class=’jfradio’ id=’h94b8_2456′>
<div class=’control-group’>
<legend id=”h94b8_2456_label”>Overall</legend>
<div class=’controls’>
<label class=’radio’ for=’h94b8_2456_0′>
<input value=’Good’ id=’h94b8_2456_0′ name=’h94b8′ type=’radio’ />
Good
</label>
<label class=’radio’ for=’h94b8_2456_1′>
<input checked=checked value=’Average’ id=’h94b8_2456_1′ name=’h94b8′ type=’radio’ />
Average
</label>
<label class=’radio’ for=’h94b8_2456_2′>
<input value=’Poor’ id=’h94b8_2456_2′ name=’h94b8′ type=’radio’ />
Poor
</label>
<label class=’radio’ for=’h94b8_2456_3′>
<input value=’No comment’ id=’h94b8_2456_3′ name=’h94b8′ type=’radio’ />
No comment
</label>
<span class=’help-block’ id=’h94b8_2456_error’>
</div>
</div>
</fieldset>
<div>
<label for=”edit-submitted-comments”>Comments </label>
<div><textarea id=”edit-submitted-comments” name=”submitted[comments]” cols=”60″ rows=”5″></textarea></div>
</div>
<div><input type=”submit” name=”op” value=”Submit” /></div></div></form><span property=”dc:title” content=”Website feedback form”> </div>
</body>
</html>
</code>
g) Write a program using VBscipt that adds only diagonal elements of two matrices. The program should be efficient.
<code>
hh’vb script program to find sum of diagonal elements in the given matrix ‘
declare double dimentional array
dim a(2,2)
dim sum,k sum=0 k=0
for i=0 to ubound(a,1)
for j=0 to ubound(a,2)
a(i,j)=cint(inputbox(“enter elements”))
next
sum=sum+a(i,k)
k=k+1
next
msgbox sum
</code>
Screen Shots:
ignou.nisecomputers.com
MCSL 016 solved assignment 2014-2015
ignou.nisecomputers.com

Question 1: 
Describe an algorithm for finding both the largest and the smallest integers in a finite sequence of integers in an array and count them how many comparison operation are involved.
Solution:-
C code to find largest and smallest number in an array
#include<stdio.h>
int main()
{
  int a[50], size, i, big, small, count = 0;
  printf("\nEnter the size of the array: ");
  scanf("%d", &size);
  printf("\n Enter %d elements in to the array: ", size);
  for(i=0; i<size; i++)
      scanf("%d", &a[i]);
  big = a[0];
  for(i = 1; i < size; i++){
      if(big < a[i])      
           big = a[i];
              {
                 count++;
              }
  }
  printf(" Largest element: %d \n ", big);
  small = a[0];
  for(i=1; i<size; i++)
{
      if(small > a[i])
              {
                  count++;
              }
           small = a[i];
  }
  printf(" Smallest element: %d \n ", small);
  printf(" number of comparison %d ", count);
  return 0;
}
Output:
Untitled
Algorithm:
step 1 : Start
step 2 : Declare variables int a[50], size, i, big, small, count = 0 step 3 : read value
step 4 : get the value element for the array                         step 5 : begin the operation for largest number
               in loop if big is less than a[i]
               do small = a[i]
               count the comparison 
                               comparison ++
step 6 : Display Largest element
step 7 : begin the operation for small  number
               in loop if small is greater than a[i]
               do big = a[i]
               count the comparison 
                               comparison ++
step 8 : Display Smallest element
step 9 : stop.
Question 2:Write Prim’s algorithm and apply it to find a minimum cost spanning tree of the following Graph. Show all the steps.
q2
Solution:-
How does Prim’s Algorithm Work?The idea behind Prim’s algorithm is simple, a spanning tree means all vertices must be connected. So the two disjoint subsets of vertices must be connected to make a Spanning Tree. And they must be connected with the minimum weight edge to make it a Minimum Spanning Tree (mst).
q2
Pick the vertex with minimum key value. The vertex B is picked, as it has mstSET value 3 We repeat this steps until mstSet doesn’t include all vertices of given graph.
Untitled1
Untitled2 Untitled3 Untitled4Untitled5
Finally we get the following graph.Untitled6
Question 3: 
(i) Apply Dijkstra’s algorithm to find shortest path from source vertex A to each of other vertices of following directed graph. Show all the steps.
img1(ii) Differentiate between Bellman-Ford and Dijkstra’s algorithm to find a shortest path in a graph.
Solution:-(i) Apply Dijkstra’s algorithm to find shortest path from source vertex A to each of other vertices of following directed graph. Show all the steps.
Initial step:
sDist[A] = 0; the value to the source itselfsDist[B]= ∞, sDist[C]= ∞, sDist[D]= ∞, sDist[E]= ∞; the nodes not processed yetUntitled1
Step 1Adj[A] = {B,C}; computing the value of the adjacent vertices of the graphsDist[B] = 10;
sDist[C] = 7;
Untitled2
Step 2Computation from vertex CAdj[C] = {B, D, E};
sDist[B] > sDist[C] + EdgeCost[C,B]
10 > 7 + 2 (True)
Therefore, sDist[B] = 9;
sDist[D] = 11;
sDist[E] = 10;
Untitled5
Step 3Adj[E]=0; means there is no outgoing edges from E
And no more vertices, algorithm terminated. Hence the path which follows the algorithm is:
Untitled6
Figure: the path obtained using Dijkstra’s Algorithm
(ii) Differentiate between Bellman-Ford and Dijkstra’s algorithm to find a shortest path in a graph.
Bellman-Ford algorithm is a single-source shortest path algorithm, which allows for negative edge weight and can detect negative cycles in a graph.
Dijkstra algorithm is also another single-source shortest path algorithm. However, the weight of all the edges must be non-negative.
The vertexes in Dijkstra’s algorithm contain the whole information of a network. There is no such thing that every vertex only cares about itself and its neighbors. On the other hand, Bellman-Ford algorithm’s nodes contain only the information that are related to. This information allows that node just to know about which neighbor nodes can it connect and the node that the relation come from, mutually. Dijkstra’s algorithm is faster than Bellman-Ford’s algorithm however the second algorithm can be more useful to solve some problems, such as negative weights of paths.
In above Graph, as far as the total cost is concerned, there will be no difference, since the edges in the graph have non-negative weight. However, Dijkstra’s algorithm is usually used, since the typical implementation with binary heap has Theta ((|E|+|V|)log|V|) time complexity, while Bellman-Ford algorithm has O(|V||E|) complexity.
Question 4:
Write a pseudo code for Quicksort and partition algorithms. Illustrate the operation of partition procedure on the following sequence.
A = <25,5,30,40,15,65,20,35>
Solution:-
(a) Pseudo code for Quicksort:
Quicksort (A, p, r) // Sort A[p .. r] into ascending order.
1. if (p < r)
1.1 q = Partition(A, p, r)
1.2 Quicksort(A, p, q-1)
1.3 Quicksort(A, q+1, r)
(b) Pseudo code for Partition:
Partition (A, p, r) // It is assumed that p <= r.
1. x = A[r]; i = p-1; // x is the pivot value.
2. for j = p to r-1 do
if (A[j] <= x) {i = i + 1
Exchange A[i] with A[j].}
3. Exchange A[i+1] with A[r].
4. return i+1.
Example of Sequence A = <25, 5 30, 40, 15, 65, 20, 35>
/* A typical recursive implementation of quick sort */
#include<stdio.h>
// A utility function to swap two elements
void swap(int* a, int* b)
{
    int t = *a;
    *a = *b;
    *b = t;
}
/* This function takes last element as pivot, places the pivot element at its correct position in sorted array, and places all smaller (smaller than pivot) to left of pivot and all greater elements to right of pivot */
int partition (int arr[], int l, int h)
{
    int x = arr[h];    // pivot
    int i = (l - 1);  // Index of smaller element
    for (int j = l; j <= h- 1; j++)
    {
        // If current element is smaller than or equal to pivot
        if (arr[j] <= x)
        {
            i++;    // increment index of smaller element
       swap(&arr[i], &arr[j]);  // Swap current element with index
        }
    }
    swap(&arr[i + 1], &arr[h]); 
    return (i + 1);
}
/* arr[] --> Array to be sorted, l  --> Starting index, h  --> Ending index */
void quickSort(int arr[], int l, int h)
{
    if (l < h)
    {
        int p = partition(arr, l, h); /* Partitioning index */
        quickSort(arr, l, p - 1);
        quickSort(arr, p + 1, h);
    }
}
/* Function to print an array */
void printArray(int arr[], int size)
{
    int i;
    for (i=0; i < size; i++)
        printf("%d ", arr[i]);
    printf("\n");
}
// Driver program to test above functions
int main()
{
    int arr[] = {25,5,30,40,15,65,20,35};
    int n = sizeof(arr)/sizeof(arr[0]);
    quickSort(arr, 0, n-1);
    printf("Sorted array: \n");
    printArray(arr, n);
    return 0;
}
Output:-
quicksort
Question 5:Illustrate representation of the following graph:(a) Through adjacency matrix and adjacency list
adjacency
(b) (i) Suppose most of the entries in the adjancy matrix are zeroes, i.e. when a graph is sparse, how much time is needed to find number of edges in a graph. 
(ii) What is the storage required for an adjacency list of any graph.
Solution:-(a) Through adjacency matrix and adjacency list
adjacencylist

(b) (i) Suppose most of the entries in the adjancy matrix are zeroes, i.e. when a graph is sparse, how much time is needed to find m number of edges in a graph.
It will take much less time if say 0 (e + n), where e is the number of edges is a graph and e << n2/2. But this can be achieved if a graph is represented through an adjacency list where only the edges will be represented.
(ii) What is the storage required for an adjacency list of any graph.
Adjacency ListPutting it in another way of an adjacency list represents only columns of the adjacency matrix for a given vertex that contains entries as 1’s. It is to be observed that adjacency list compared to adjacency matrix consumes less memory space if a graph is sparse. A graph with few edges is called sparse graph. If the graph is dense, the situation is reverse. A dense graph, is a graph will relatively few missing edges. In case of an undirected graph with n vertices and e edge adjacency list requires n head and 2 e list nodes (i.e. each edges is represented twice).
The storage required (in terms of bits) for an adjacency list of any graph.
(i) For storing n (n vertices) head nodes – we require – log2 n bits –
(ii) For storing list nodes for each head  nodes – we require log n + log e
Therefore total storage requirement in item of bits for adjacency matrix is
2log2n (2log2n + log2e)
Question 6:Explain the following items with(i) Asymptotic bounds(ii) Greedy techniques(iii) DFS(iv) Recursion tree method
Solution:-
(i) Asymptotic boundsAn algorithm provides an approach to solve a given problem. The key components of an algorithm are input, processing and output. Generally all algorithms works well for small size input irrespective of the complexity. So we need to analyze the algorithm for large value of input size. It is also possible that one problem have many algorithmic solutions. To select the best algorithm for an instance of task or input we need to compare the algorithm to find out how long a particular solution will take to generate the desired output. We will determine the behavior of function and running time of an algorithm as a function of input size for large value of n. This behavior can be expressed using asymptotic notations.
To understand concepts of the asymptotic notations first we need to get idea of lower bound, upper bound and how to represent time complexity expression for various algorithms. This is like expressing cost component of an algorithm.
The basic five asymptotic notations are:
1 Theta Notation ()
2 Big Oh Notation (O)
3 Big Omega Notation ()
4 Small o Notation (o)
5 Small Omega Notation
(ii) Greedy techniquesGreedy technique is a general algorithm design strategy, built on following elements:
• configurations: different choices, values to find• objective function: some configurations to be either maximized or minimized
The method:• Applicable to optimization problems ONLY• Constructs a solution through a sequence of steps
• Each step expands a partially constructed solution so far, until a complete solution to the   problem is reached.
On each step, the choice made must be
• Feasible: it has to satisfy the problem’s constraints
• Locally optimal: it has to be the best local choice among all feasible choices available on that step
• Irrevocable: Once made, it cannot be changed on subsequent steps of the algorithm
NOTE:• Greedy method works best when applied to problems with the greedy-choice property
• A globally-optimal solution can always be found by a series of local improvements from a starting configuration.
(iii) DFS            Depth-First Search We are aware of tree traversal mechanism. Give a tree, we can traverse it using preorder, inorder and postorder. Similarly given an undirected graph we can traverse it or visit its nodes using breadth first-search and depth-first search.
Searching in breadth-first search or depth first search means exploring a given graph. Through searching a graph one can find out whether a graph is connected or not? There are many more applications of graph searching algorithms.
The logic behind this algorithm is to go as far as possible from the given starting node searching for the target. In case, we get a node that has no adjacent/successor node, we get back (recursively) and continue with the last vertex that is still not visited.
Broadly it is divided into 3 steps:
  • Take a vertex that is not visited yet and mark it visited
  • Go to its first adjacent non-visited (successor) vertex and mark it visited
  • If all the adjacent vertices (successors) of the considered vertex are already visited or it doesn’t have any more adjacent vertex (successor) – go back to its parent vertex
(iv) Recursion tree method                recursion tree is useful for visualizing what happens when a recurrence is iterated. It diagrams the tree of recursive calls and the amount of work done at each call.
For instance, consider the recurrence
T(n) = 2T(n/2) + n2.
The recursion tree for this recurrence has the following form:
lec19-diagram1
In this case, it is straightforward to sum across each row of the tree to obtain the total work done at a given level:lec19-diagram2 This a geometric series, thus in the limit the sum is O(n2). The depth of the tree in this case does not really matter; the amount of work at each level is decreasing so quickly that the total is only a constant factor more than the root.
Recursion trees can be useful for gaining intuition about the closed form of a recurrence, but they are not a proof (and in fact it is easy to get the wrong answer with a recursion tree, as is the case with any method that includes ”…” kinds of reasoning). As we saw last time, a good way of establishing a closed form for a recurrence is to make an educated guess and then prove by induction that your guess is indeed a solution. Recurrence trees can be a good method of guessing.
Let’s consider another example,
T(n) = T(n/3) + T(2n/3) + n.
Expanding out the first few levels, the recurrence tree is:lec19-diagram3
Note that the tree here is not balanced: the longest path is the rightmost one, and its length is log3/2 n. Hence our guess for the closed form of this recurrence is O(n log n).
Question 7:Briefly describe running time of important algorithms under different classes.  (10 Marks)
Solution:-
Click Here to get the Solution for this Question no. 7
Question 8:What are the different approaches of solution to recursion relation? Solve the following recurrence relation by master method.
T (n) =2T(n/2)+n
Solution:-
Many algorithms are recursive in nature. When we analyze them, we get a recurrence relation for time complexity. We get running time on an input of size n as a function of n and the running time on inputs of smaller sizes. For example in Merge Sort, to sort a given array, we divide it in two halves and recursively repeat the process for the two halves. Finally we merge the results. Time complexity of Merge Sort can be written as T(n) = 2T(n/2) + cn. There are many other algorithms like Binary Search, Tower of Hanoi, etc.
There are mainly three ways for solving recurrences.
1) Substitution Method: We make a guess for the solution and then we use mathematical induction to prove the guess is correct or incorrect.
2) Recurrence Tree Method: In this method, we draw a recurrence tree and calculate the time taken by every level of tree. Finally, we sum the work done at all levels. To draw the recurrence tree, we start from the given recurrence and keep drawing till we find a pattern among levels. The pattern is typically a arithmetic or geometric series.
3) Master Method: Master Method is a direct way to get the solution. The master method works only for following type of recurrences or for recurrences that can be transformed to following type.
The master method is a cookbook method for solving recurrences. Although it cannot solve all recurrences, it is nevertheless very handy for dealing with many recurrences seen in practice.
T (n) =2T(n/2)+n
    T(n)  = 2T(n/2)+ n
        = 2(2T(n/4))+ n/2)+ n
        = 4T(n=4)+2n
               = 8T(n=8)+3n =
It looks like T(n) satisfies the recurrence T(n) = 2kT(n=2k)+ kn for any positive integer k. Let’s verify this by induction.
T(n)  = 2T(n=2)+ n = 21T(n=21)+1.n  [k = 1, given recurrence]
T(n)  = 2k-1T(n=2 k-1)+(k -1)n     [inductive hypothesis]
       = 2 k-1(2T(n/2k)+ n/2 k-1)+(k -1)n   [substitution]
       = 2kT(n=2k)+ kn                     [algebra]
Our guess was right! The recurrence becomes trivial when n/2= 1, or equivalently,
when = log2 n:
      T(n) = nT(1)+ n log2 n = n log2 n+ n.
Finally, we have to put back the _’s we stripped off; our final closed-form
solution is T(n) = Ã˜ (logn).