Sunteți pe pagina 1din 88

ZZ

SBM001

XX
Which of the following markup languages is used for data description and definition? Which of the following models focuses on the roles of people and organizations in getting work done?

XX
1, HTML

XX
2, WML

XX
3, SGML

SBM002

1, Process and workflow models 2, Data flow models 1, <?xml version="1.0"?> 2, <?xml version="1.0"?>

3, Use cases 3, <?xml version="1.0"?>

<AUTHORS>

<AUTHORS>

<AUTHORS>

<AUTHOR>

<AUTHOR>

<AUTHOR>

<FIRSTNAME>JOHN</ <FIRSTNAME>JOHN</ <FIRSTNAME>JOHN</ FIRSTNAME> FIRSTNAME> FIRSTNAME> <LASTNAME>NORTON <LASTNAME>NORTON <LASTNAME>NORTON </LASTNAME> </LASTNAME> </LASTNAME>

</AUTHOR>

</AUTHOR>

</AUTHORS>

SBM003

SBM004

</authors> Which of the following options is a valid XML document? </AUTHORS> Bob is working as an EDP head for CyberShoppe Inc. Cybershoppe sells toys and books in the United States. Cybershoppe is currently using EDI to interchange data 1, Bob should use HTML 2, Bob should use XML across Accounts and Sales departments. The format instead of EDI instead of EDI Which of the following data types in XML schemas is derived from the atomic and list data types?

</AUTHOR> 3, Bob should use SGML instead of EDI

SBM005

1, Union data types

2, Primitive data types

3, Derived data types

SBM006

Which of the following options is the base data type for the time data type? 1, timeDuration

2, recurringDuration

3, Integer

SBM007

Which of the following values of the use attribute ensures that an attribute is always set to some value? Joe has created a global attribute named basicPay. Which of the following attributes will he use to access basicPay? Which of the following statements is NOT true about XML namespaces? Which of the following keywords is used to declare a namespace in an XSD document?

1, optional

2, default

3, required

SBM008

SBM009

1, use 1, A namespace is a method of preventing conflicts between elements with the same

2, name 2, A namespace is a virtual space that is assigned or recognized by a URI.

3, ref 3, A namespace URI is same as a Web URI

SBM010

SBM011

SBM012

1, xmlns 1, The include element is used to include or Which of the following options is NOT true about include refer to an external element? schema that is located You want to refer a set of related elements by using a common name in an XML schema. Which of the following elements can be incorporated into a complex data type to achieve this? 1, sequence Which of the following text properties can be applied only to inline elements? Which of the following statements is NOT true about XSLT? Which of the following characters in Xpath expressions searches for the specified element at any node level?

2, xsd 2, The include element contains the schemaLocation attribute.

3, xmlau 3, The include element can have multiple occurrences in an XSD document.

2, group

3, attributeGroup

SBM013

1, vertical-align

2, text-transform 2, Written using XML and follows XML syntax

3, text-align

SBM014

1, Uses less memory

3, Complex to use

SBM015

1, //

2, /

3, .

SBM016

Which of the following operators is used to check whether a value of price is greater than or equal to 20? 1, PRICE[ . &&gt;= 20] Which of the following HTML tags is used as a parent for the TR and TD elements?

2, PRICE[ . &&gt= 20]

3, PRICE[ . &&gt=; 20]

SBM017

1, THead

2, TBody

3, TH

SBM018

Which of the following XML DOM Objects represents a collection of Node objects and is used to iterate through the collection? 1, Document object Which of the following XML DOM properties indicates whether the document has been loaded completely?

2, Element object

3, Node object

SBM019

1, readyState

2, async

3, validateOnParse

What will be the output of the following string function:

SBM020

SBM021

substring('MM/DD/YY',2) Which of the following options is a valid XMLSchemaCache method that returns the namespace associated with the schema at the specified index number?

1, M/DD/YY

2, MM

3, DD/YY

1, namespaceURI(index number) 2, get(namespaceURI)

3, get()

SBM022

Joe wants to write a script that will be used to access an XSLT stylesheet. Which of the following DOM objects Joe needs to use to achieve this? 1, XSLTemplate object 1, var namespace=xmlDoc.doc umentElement.namespa ceURI; xmlDoc.validateOnParse =true; var xsdschemacache = new ActiveXObject("Msxml2. XMLSchemaCache.6.0")

2, XSLProcessor Object 2, var namespace=xmlDoc.doc umentElement.namespa ceURI;

3, DOMDocument 3, var namespace=xmlDoc.na mespaceURI;

xmlDoc.validateOnParse xmlDoc.validateOnParse =true; =true; var xsdschemacache = new var xsdschemacache = ActiveXObject("Msxml2. new ActiveXObject(); XMLSchemaCache.6.0")

xsdschemacache.add(na xsdschemacache.add(na xsdschemacache.add(na mespace,document.frm mespace,document.frm mespace,document.frm Transform. Transform. Transform.

TxtXSDFileName.value); TxtXSDFileName.value); TxtXSDFileName.value); Bob is working as an EDP head in CyberShoppe. He has to ensure that the data sent in the form of XML documents is consistent. For this, he wants to write a script that validates the data stored in an XML document against a schema. Identify the correct code that Bob should write that will associate the XML document with the XML schema specified by the user. xmlDoc.schemas=xsdsc xmlDoc.schemas=xsdsc xmlDoc.schemas=xsdsc hemacache; hemacache; hemacache; xmlDoc.load(document.f rmTransform.TxtXMLFile Name.value); 2, The number of parameters passed to the createNode method is incorrect. The correct xmlDoc.load(document.f rmTransform.TxtXMLFile Name.value); 3, The number of parameters passed to the createNode method is incorrect. The correct

SBM023

xmlDoc.load(document.f rmTransform.TxtXMLFile Name.value); 1, The number of parameters passed to Bob has written the following code snippet to create an the createNode method element node called Product: is incorrect. The correct

var docobj=new ActiveXObject("Msxml2.DOMDocument.6.0");

var docobj = new var docobj = new var docobj = new ActiveXObject("Msxml2. ActiveXObject("Msxml2. ActiveXObject("Msxml2. DOMDocument.6.0"); DOMDocument.6.0"); DOMDocument.6.0");

docobj.async=false;

docobj.async=false;

docobj.async=false;

docobj.async=false;

if (docobj.childNodes.length==0)

if if if (docobj.childNodes.leng (docobj.childNodes.leng (docobj.childNodes.leng th==0) th==0) th==0)

myroot=docobj.createNode("Product");

myroot=docobj.createN myroot=docobj.createN myroot=docobj.createN ode(2,"Product",""); ode(1,"Product"); ode(2,"Product"); docobj.appendChild(myr docobj.appendChild(myr docobj.appendChild(myr oot); oot); oot); docobj.save("d:\Prod.x ml"); docobj.save("d:\Prod.x ml"); docobj.save("d:\Prod.x ml");

docobj.appendChild(myroot);

docobj.save("d:\Prod.xml");

SBM024

But on executing the code snippet, it resulted in an error. Identify the error in the code. 1, var myxmldoc=new 2, var myxmldoc=new 3, var myxmldoc=new ActiveXObject("Msxml2. ActiveXObject("Msxml2. ActiveXObject("Msxml2. DOMDocument.6.0"); DOMDocument.6.0"); DOMDocument.6.0");

Bob has created the following XML file:

var i;

var i;

var i;

<?xml version="1.0"?>

myxmldoc.async=false; myxmldoc.async=false; myxmldoc.async=false; myxmldoc.load("C:\\em p.xml"); if (myxmldoc.readyState == 4 && myxmldoc.parseError.e myxmldoc.load("C:\\em p.xml"); if (myxmldoc.readyState == 1 && myxmldoc.parseError.e myxmldoc.load("C:\\em p.xml"); if (myxmldoc.readyState == 3 && myxmldoc.parseError.e

<empfolio>

<emp>

<empname>John Rambo</empname>

<empcity>Texas</empcity>

var var var root=myxmldoc.docume root=myxmldoc.docume root=myxmldoc.docume ntElement; ntElement; ntElement; for (i=0; i< root.childNodes.length; ++ i) for (i=0; i< root.childNodes.length; ++ i) for (i=0; i< root.childNodes.length; ++ i)

</emp>

<emp>

<empname>James Bond</empname>

alert alert alert (root.childNodes.item(i). (root.childNodes.item(i). (root.childNodes.item(i). xml); xml); xml);

<empcity>London</empcity>

</emp>

</empfolio>

else

else

else

{ { { alert("Failed to load the alert("Failed to load the alert("Failed to load the document. Check document. Check document. Check whether your XML whether your XML whether your XML document is welldocument is welldocument is well-

SBM025

SBM025

He has saved the preceding document as emp.xml. Now, he wants to create a file that will navigate through the child nodes of the root element in the preceding document. Which of the following code

Bob has created the following XML file:

<SUMMARY>

<PRODUCT ID="P001" NAME="Mini Bus" PRICE="75">

<ORDER ID="O001"> <SHIP_ADD>10 NEWSLAND ESTATE, NY</SHIP_ADD>

<QUANTITY>30</QUANTITY>

</ORDER>

<ORDER ID="O002"> <SHIP_ADD>11 NEWSLAND ESTATE, NY</SHIP_ADD>

<QUANTITY>50</QUANTITY>

</ORDER>

</PRODUCT>

</SUMMARY>

SBM026

SBM027

SBM028

SBM029

Bob wants to calculate the total sales amount for a product. Which of the following options will enable Bob to achieve this task? Bob wants to use an XPath function that will return the largest integer that is less than or equal to the argument. Which of the following functions will enable Bob to achieve this task? Bob wants to create a stylesheet that will display the details of the product whose price is equal to $500. Which of the following code snippets enables Bob to check the product's price? Bob wants to process an XML document by using a style sheet. For this, he needs to instantiate the XSLProcessor object. Which of the following options will enable him to achieve this task? Bob has created the Product.xml file. The Product.xml contains the following information:

1, <xsl:value-of select='(./@PRICE) * sum(./ORDER/QUANTIT Y)' />

2, <xsl:value-of select='(./PRICE) * sum(./ORDER/QUANTIT Y)' />

3, <xsl:value-of select='(@PRICE) * sum(ORDER/QUANTITY) ' />

1, floor(num) 1, <xsl:if test="PRICE [. = 500]"> 1, var xslprocobj=xsltobj.creat eProcessor(); 1, <xsl:stylesheet xmlns:xsl="http://www. w3.org/1999/XSL/Trans form" version="1.0"> <xsl:template match="/">

2, ceiling(num) 2, <xsl:if test="PRICE [. = 500]" /> 2, var xslprocobj=new createProcessor(); 2, <xsl:stylesheet xmlns:xsl="http://www. w3.org/1999/XSL/Trans form" version="1.0"> <xsl:template match="/">

3, round(num) 3, <xsl:if select="PRICE [. = 500]"> 3, var xslprocobj=new ActiveXObject(xsltobj); 3, <xsl:stylesheet xmlns="http://www.w3. org/1999/XSL/Transfor m" version="1.0"> <xsl:template match="/">

<?xml version="1.0"?>

<html>

<html>

<html>

<PRODUCTDATA>

<body> <xsl:for-each select="PRODUCTDATA/ PRODUCT"> <li><xsl:valu e-of select="PRODUCTNAME "/></li> <li><xsl:valu e-of select="DESCRIPTION"/ ></li>

<body> <li><xsl:valu e-of select="PRODUCTNAME "/></li> <li><xsl:valu e-of select="DESCRIPTION"/ ></li> <li><xsl:valu e-of select="QUANTITY"/>< /li>

<body> <xsl:for-each select="PRODUCTDATA/ PRODUCT"> <li><xsl:valu e-of select="PRODUCTNAME "/></li> <li><xsl:valu e-of select="DESCRIPTION"/ ></li>

<PRODUCT>

<PRODUCTNAME>Mini Bus</PRODUCTNAME> <DESCRIPTION>This is a toy for children aged 4 and

above</DESCRIPTION>

<li><xsl:valu <li><xsl:valu e-of <li><xsl:valu e-of select="QUANTITY"/>< e-of select="QUANTITY"/>< /li> select="PRICE"/></li> /li> <li><xsl:valu e-of select="PRICE"/></li> <li><xsl:valu e-of select="PRICE"/></li>

<PRICE>75</PRICE>

<br></br>

<QUANTITY>54</QUANTITY>

<br></br>

</body>

<br></br>

</PRODUCT>

</body>

</html>

</xsl:for-each>

<PRODUCT>

</html>

</xsl:template>

</body>

<PRODUCTNAME>Race Car</PRODUCTNAME> <DESCRIPTION>This is a toy for children aged 6 and

</xsl:template>

</xsl:stylesheet>

</html>

</xsl:stylesheet>

</xsl:template>

above</DESCRIPTION>

</xsl:stylesheet>

<PRICE>14</PRICE>

<QUANTITY>150</QUANTITY>

</PRODUCT>

<PRODUCT>

<PRODUCTNAME>Baby's Rattle</PRODUCTNAME>

<DESCRIPTION>This is a toy for babies</DESCRIPTION>

<PRICE>5</PRICE>

<QUANTITY>25</QUANTITY>

</PRODUCT>

</PRODUCTDATA>

SBM030

Identify the correct style sheet that Bob needs to create to display the product details as a list. Bob has created customer.xml file, which contains the information of customers. The XML file contains the following information:

1, <xsl:stylesheet xmlns:xsl="http://www. w3.org/1999/XSL/Trans form" version="1.0"> <xsl:template match="/">

2, <xsl:stylesheet xmlns:xsl="http://www. w3.org/1999/XSL/Trans form" version="1.0"> <xsl:template match="/">

3, <xsl:stylesheet xmlns:xsl="http://www. w3.org/1999/XSL/Trans form" version="1.0"> <xsl:template match="/">

<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="customer.xsl"?>

<html>

<html>

<html>

<body> <xsl:for-each select="CUSTDETAILS/ CUSTOMER">

<body> <xsl:for-each select="CUSTDETAILS/ CUSTOMER">

<body> <xsl:for-each select="CUSTDETAILS" > <li><xsl:value-of select="@CUSTID"/></ li>

<CUSTDETAILS>

<CUSTOMER CUSTID="C001">

<li><xsl:value-of <li><xsl:value-of select="@CUSTID"/></ select="CUSTID"/></li li> >

<CUSTNAME>William Anderson</CUSTNAME>

<li><xsl:value-of select="CUSTNAME"/> </li>

<li><xsl:value-of select="CUSTNAME"/> </li>

<li><xsl:value-of select="CUSTNAME"/> </li>

<ADDRESS>13, Cross Street</ADDRESS>

<li><xsl:value-of <li><xsl:value-of <li><xsl:value-of select="ADDRESS"/></ select="ADDRESS"/></ select="ADDRESS"/></ li> li> li> <li><xsl:value-of select="CITY"/></li> <li><xsl:value-of select="STATE"/></li> <li><xsl:value-of select="CITY"/></li> <li><xsl:value-of select="STATE"/></li> <li><xsl:value-of select="CITY"/></li> <li><xsl:value-of select="STATE"/></li>

<CITY>New York</CITY>

<STATE>New York</STATE>

<COUNTRY>USA</COUNTRY>

<li><xsl:value-of <li><xsl:value-of <li><xsl:value-of select="COUNTRY"/></l select="COUNTRY"/></l select="COUNTRY"/></l i> i> i> <li><xsl:value-of <li><xsl:value-of <li><xsl:value-of select="PHONE"/></li> select="PHONE"/></li> select="PHONE"/></li>

<PHONE>6785764</PHONE>

</CUSTOMER>

<br></br>

<br></br>

<br></br>

<CUSTOMER CUSTID="C002">

</xsl:for-each>

</xsl:for-each>

</xsl:for-each>

<CUSTNAME>Bill Sanders</CUSTNAME>

</body>

</body>

</body>

<ADDRESS>13, Crick Street</ADDRESS>

</html>

</html>

</html>

<CITY>Seattle</CITY>

</xsl:template>

</xsl:template>

</xsl:template>

<STATE>Washington</STATE>

</xsl:stylesheet>

</xsl:stylesheet>

</xsl:stylesheet>

<COUNTRY>USA</COUNTRY>

<PHONE>608475</PHONE>

</CUSTOMER>

</CUSTDETAILS>

SBM031

Now, he wants to create an XSLT style sheet that displays the information in bulleted list. Identify the code that he needs to write to create the XSLT style sheet. Which of the following scripting languages is developed by Netscape Communication Corporation? 1, JavaScript Which of the following objects contains the document, frame, location, and history objects?

SBM032

2, VBScript

3, JScript

SBM033

1, window

2, form

3, navigator

SBM034

SBM035

Which of the following window objects properties is used to display a message in the status bar of the window when no other transient message is displayed? 1, parent Joe is working as a Web designer with Global Inc. He is designing a Web page in which he needs to facilitate the users to modify the data entered by them on the Web document. Which of the following objects will Joe 1, window

2, frames

3, length

2, document

3, frame

SBM036

Which of the following options is an empty tag in HTML? 1, <br> Which of the following HTML tags is used to group lines of text in a Web page? 1, <p> Joe is working as a Web designer with Global Inc. He is designing a Web page in which he wants to specify the key aspects of a Web page. Which of the following HTML tags should Joe use to achieve this task? 1, <HR>

2, <b>

3, <h1>

SBM037

2, <b>

3, <i>

SBM038

2, <P>

3, <TITLE>

1, <HTML>

2, <HTML>

3, <HTML>

<BODY>

<BODY>

<BODY> <IMG SRC="image.gif" USEMAP="#map_sectio n"> <MAP NAME="down_map">

<IMG SRC="image.gif" USEMAP="#map_sectio <MAP n"> NAME="down_map"> <AREA Name="exit" COORDS="10,10,50,50" <MAP SHAPE="rect" NAME="down_map"> HREF="image.gif"> <AREA Name="exit" COORDS="10,10,50,50" SHAPE="rect" HREF="image.gif"> </BODY> Joe is working as a Web designer with Global Inc. He is designing a Web page in which he wants to display an </BODY> image map named image.gif. The image map should be displayed on the 10, 10, 50, 50 coordinates. Which of the following code should Joe use to display an image </HTML> map? 1, <xsd:simpleType name="Price">

</BODY>

</HTML>

</HTML>

SBM039

2, <xsd:simpleType name="Price" restriction="xsd:positive 3, <xsd:simpleType Integer"> name="Price">

<xsd:restriction <xsd:maxInclusive <xsd:restriction base="xsd:positiveInteg value="400"></xsd:ma base="xsd:positiveInteg er"> xInclusive> er"> <xsd:maxInclusive <xsd:minInclusive <xsd:max value="400"></xsd:ma value="10"></xsd:minI value="400"></xsd:ma xInclusive> nclusive> x> <xsd:minInclusive value="10"></xsd:minI nclusive> </xsd:simpleType> <xsd:min value="10"></xsd:min >

SBM040

You want to create a simple type element named Price. You want to ensure that the element should contain a value greater than 10 but less than 400. Which of the following code snippets will you use to create the element? You want to create an attribute named PRODID. You want to ensure that the attribute should contain a value that starts with P followed by three integer numbers. For this, you have created a schema that contains the

</xsd:restriction>

</xsd:restriction>

</xsd:simpleType> 1, <xsd:schema xmlns:xsd="http://www .w3.org/2001/XMLSche ma">

2, <xsd:schema xmlns:xsd="http://www .w3.org/2001/XMLSche ma">

</xsd:simpleType> 3, <xsd:schema xmlns:xsd="http://www .w3.org/2001/XMLSche ma">

<xsd:attribute name="PRODID" type="pID" use="required"> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="PRODID" type="pID" use="required"/> <xsd:simpleType name="pID"> <xsd:restriction base="xsd:string"> <xsd:pattern value="[P]{1}\d{3}"/ >

<xsd:attribute name="PRODID" type="pID" use="required"/> <xsd:simpleType name="pID"> <xsd:restriction base="xsd:string"> <xsd:pattern value="[P] \d{3}"/>

<xsd:attribute name="PRODID" type="pID" use="required"/> <xsd:simpleType name="pID"> <xsd:pattern value="[P]{1}\d{3}"/ >

<xsd:simpleType name="pID"> <xsd:restriction base="xsd:string" value="[P]{1}\d{3}" />

</xsd:simpleType>

</xsd:restriction>

</xsd:restriction>

</xsd:schema>

</xsd:simpleType>

</xsd:simpleType>

</xsd:simpleType>

</xsd:schema>

</xsd:schema>

</xsd:schema>

SBM041

SBM042

The above code snippet is not working properly. Identify the correct code snippet that will help you achieve this task? You have been assigned a task to create an XML schema that is using namespaces with attributes. Which of the following options is NOT true regarding the rules for using namespaces with attributes? You have been assigned a task of creating an XML schema using XSD. You have to explicitly declare a namespace using the following code snippet:

1, Declarations of the default namespaces do not affect attribute names

3, A start tag must not 2, Attribute names may contain two attribute contain only zero or one names with a common colon (:) characters. local part and different

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

</xsd:schema> 3, Explicit namespaces are used in an XSD document that uses the elements and attributes defined in one or more namespaces.

SBM043

SBM044

Which of the following statements is NOT true for the preceding code snippet? You have been assigned a task of creating a XSD schema. You need to ensure that the value entered by the user for the element addressType should be either office or residence. Which of the following options will You have created the following XSD schema that will enable you to use the elements in any order of your choice:

2, Elements that explicitly use the prefix 1, You need not specify comes under the scope the prefix for an explicit of the specified namespace namespace.

1, <xsd:sequence> 1, <xsd:schema xmlns:xsd="http://www .w3.org/2001/XMLSche ma"> <xsd:element name="EMPLOYEE"/>

2, <xsd:choice> 2, <xsd:schema xmlns:xsd="http://www .w3.org/2001/XMLSche ma"> <xsd:element name="EMPLOYEE" type="emptype" /> <xsd:complexType name="emptype">

3, <xsd:all> 3, <xsd:schema xmlns:xsd="http://www .w3.org/2001/XMLSche ma"> <xsd:element name="EMPLOYEE"/> <xsd:complexType name="emptype">

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:complexType name="emptype">

<xsd:element name="EMPLOYEE" type="emptype" />

<xsd:sequence> <xsd:element name="FIRSTNAME" type="xsd:string"/> <xsd:element name="LASTNAME" type="xsd:string"/> <xsd:element name="DESIG" type="xsd:string"/>

<xsd:all> <xsd:element name="FIRSTNAME" type="xsd:string"/> <xsd:element name="LASTNAME" type="xsd:string"/> <xsd:element name="DESIG" type="xsd:string"/>

<xsd:all> <xsd:element name="FIRSTNAME" type="xsd:string"/> <xsd:element name="LASTNAME" type="xsd:string"/> <xsd:element name="DESIG" type="xsd:string"/>

<xsd:complexType name="emptype">

<xsd:choice> <xsd:element name="FIRSTNAME" type="xsd:string"/>

<xsd:element name="LASTNAME" type="xsd:string"/> <xsd:element name="DESIG" type="xsd:string"/> <xsd:element name="DEPARTMENT" type="xsd:string"/>

<xsd:element name="DEPARTMENT" type="xsd:string"/>

<xsd:element name="DEPARTMENT" type="xsd:string"/>

<xsd:element name="DEPARTMENT" type="xsd:string"/>

</xsd:sequence>

</xsd:all>

</xsd:all>

</xsd:complexType>

</xsd:complexType>

</xsd:complexType>

</xsd:choice>

</xsd:schema>

</xsd:schema>

</xsd:schema>

</xsd:complexType>

</xsd:schema>

SBM045

However on executing the XSD, it does not work properly. Identify the correct XSD code that you need to create so the elements can be used in any order of your choice. Joe has created the following XSD schema to declare the reusable data types that stores product id and order id: 1, <schema xmlns="http://www.w3. org/2001/XMLSchema" targetNamespace="ww w.ecomatcybershop.co m/purchase" xmlns:prd="www.ecom 2, <schema xmlns="http://www.w3. org/2001/XMLSchema" targetNamespace="ww w.ecomatcybershop.co m" xmlns:prd="www.ecom <include schemaLocation="potyp e.xsd"/> <element name="PURCHASEORD ER" type="prd:purord"/> <complexType name="purord"> 3, <schema xmlns="http://www.w3. org/2001/XMLSchema" targetNamespace="ww w.ecomatcybershop.co m/purchase" xmlns:prd="www.ecom <include schema="potype.xsd"/ > <element name="PURCHASEORD ER" type="prd:purord"/> <complexType name="purord">

<include schemaLocation="potyp e.xsd"/> <element name="PURCHASEORD targetNamespace="www.ecomatcybershop.com/purcha ER" se"> type="prd:purord"/> <schema xmlns="http://www.w3.org/2001/XMLSchema" <complexType name="purord">

<simpleType name="prstring">

<restriction base="string">

<sequence> <element name="ORDER" type="prd:ord"/>

<sequence> <element name="ORDER" type="prd:ord"/>

<sequence> <element name="ORDER" type="prd:ord"/>

<pattern value="[P]{1}\d{3}"/>

</restriction>

</sequence> <attribute name="PRODID" type="prd:prstring"/> <attribute name="ORDERID" type="prd:orstring" use="required"/>

</sequence> <attribute name="PRODID" type="prd:prstring"/> <attribute name="ORDERID" type="prd:orstring" use="required"/>

</sequence> <attribute name="PRODID" type="prd:prstring"/> <attribute name="ORDERID" type="prd:orstring" use="required"/>

</simpleType>

<simpleType name="orstring">

<restriction base="string">

</complexType> <complexType name="ord">

</complexType> <complexType name="ord">

</complexType> <complexType name="ord">

<pattern value="[O]{1}\d{3}"/>

</restriction>

<sequence>

<sequence>

<sequence>

</simpleType>

</schema>

Now, you want to create a schema that will use the preceding XSD schema. Which of the following code snippets is the correct code to reuse the schema created by Joe?

</sequence>

</sequence>

</sequence>

</complexType>

</complexType>

</complexType>

SBM046

SBM046 Which of the following types of list in an HTML document is used to display a set of items with a preceding number or an alphabet?

</schema>

</schema>

</schema>

SBM047

1, Nested list

2, Unordered list

3, Description list

Consider the following statements:

Statement A: The method attribute of the form tag is used to indicate how the browser needs to send the data of the form. Statement B: The action attribute of the form tag is used to specify the location to which the contents of the 1, Both, Statement A form data fields are submitted. and B, are true Which of the following types of site structures is used to present information in an associated path in which information presented in different pages of a Web site is interlinked? 1, Grid structure 1, 1. Register an account with the Internet Service Provider 2. Register a domain name 2, Both, Statement A and B, are false 3, Statement A is true, B is false

SBM048

SBM049

2, Hierarchy structure 2, 1. Register an account with the Internet Service Provider 2. Register a domain name 3. Upload the files on the Web Server

3, Sequence structure 3, 1. Choose the Services 2. Upload the files on the Web Server 3. Register an account with the Internet Service Provider 4. Register a domain name

3. Choose the Services 4. Upload the files on the Web Server Identify the correct sequence of steps required to deploy a Web site. Joe is working as a Web page designer with Global Inc. He is designing a Web page in HTML along with JavaScript. He wants to specify the build version number of the current scripting engine. Which of the

4. Choose the Services

SBM050

5. Test the Web site

5. Test the Web site

5. Test the Web site

SBM051

1, 2, 3, scriptEngineBuildVersion scriptEngineMinorVersio scriptEngineMajorVersio () n() n()

SBM052

Which of the following options correctly defines streaming?

1, Streaming is a server- 2, Streaming is the side scripting server-based technology 3, Streaming is a technology that is used that transmits audio or database query to create dynamic and video content in a language 1, <TABLE BORDER="5">

2, <TABLE >

3, <TABLE >

<TR><TD>Joe</TD>< TD>Martin</TD></TR> <BORDER="5">

<BORDER WIDTH="5">

</TABLE>

<TR><TD>Joe</TD>< <TR><TD>Joe</TD>< TD>Martin</TD></TR> TD>Martin</TD></TR>

</BORDER> Which of the following options is the correct code snippet to add a row in a table with the border of width 5 pixels? Joe has created the following schema named potype.xsd that declares the reusable data types to store product ID and order ID: <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="www.ecomatcybershop.com/purcha se">

</BORDER>

SBM053

</TABLE>

</TABLE>

<simpleType name="prstring">

<restriction base="string">

<pattern value="[P]{1}\d{3}"/>

</restriction>

</simpleType>

<simpleType name="orstring">

<restriction base="string">

<pattern value="[O]{1}\d{3}"/>

</restriction>

</simpleType>

</schema>

Now, he has created the following XSD schema that reuses the potype.xsd: <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="www.ecomatcybershop.com"

xmlns:prd="www.ecomatcybershop.com/purchase">

<include schemaLocation="potype.xsd"/> <element name="PURCHASEORDER" type="prd:purord"/>

<complexType name="purord">

<sequence>

<element name="ORDER" type="prd:ord"/>

</sequence>

<attribute name="PRODID" type="prd:prstring"/> <attribute name="ORDERID" type="prd:orstring" use="required"/>

</complexType>

<complexType name="ord">

<sequence>

</sequence>

</complexType>

</schema>

SBM054

But he is not able to reuse the schema. Identify the reason for the same.

1, He should have used 2, He should change the the schema attribute in URI specified with the 3, In XML, you cannot the include tag xmlns keyword reuse a schema

Consider the following code snippet:

var xsdschemacache = new ActiveXObject("Msxml2.XMLSchemaCache.6.0"); var xmlDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.6. 0");

xmlDoc.validateOnParse=true;

xmlDoc.load("products.xml"); var namespace=xmlDoc.documentElement.namespaceURI;

xsdschemacache.add(namespace,"products.xsd");

SBM055

Analyze the code and identify which of the following options is used to return the namespace-URI specified in the XML document.

1, namespaceURI

2, validateOnParse

3, add

SBM056

SBM057

You are writing an algorithm to solve a given problem. You want to ensure that the basic instructions of the algorithm must be realizable and can be performed by using the given inputs in a finite amount of time. Which 1, Finiteness 1, Multiple algorithms cannot be designed to Which of the following statements is NOT true about solve a particular algorithms? problem. Which of the following data structures cannot be a static data structure? 1, Stack You want to store the list of students in the memory. The number of students are not fixed in advance. Which of the following basic data structure will you use to accomplish this task? 1, Array Which of the following statements is NOT true about the divide and conquer approach? Which of the following statements is NOT true about recursion? Which of the following Big O notation represents linear order of growth? Which of the following sorting algorithm is used to overcome the limitations of insertion sort? You are sorting an array of 10 elements using bubble sort algorithm. Which of the following options represents the number of comparisons that will be performed in pass 3?

2, Definiteness 2, The efficiency of an algorithm depends on the structure of data.

3, Input 3, An algorithm is a step-by-step procedure for solving a problem.

SBM058

2, Queue

3, Array

SBM059

SBM060

3, Stack 3, This approach is used 1, This approach breaks 2, This approach is used to find the shortest a problem into to solve the trivial distance from an origin subproblems. cases. to destination. 1, Recursion is similar to the divide and conquer technique. 2, Recursive function is a function that invokes itself. 3, Tower of Hanoi problem can be solved by using recursion.

2, Linked list

SBM061

SBM062

1, O (1)

2, O (log n)

3, O (n)

SBM063

1, Quick sort

2, Shell sort

3, Merge sort

SBM064

1, 9

2, 8

3, 7

SBM065

You are sorting an array of 10 elements using selection sort. Identify the total number of comparisons that will be performed in the selection sort? 1, 54 Which of the following sorting algorithm is best suited for a list which is nearly sorted? 1, Bubble sort You are sorting a list using an algorithm. You have divided the list into two parts, sorted and unsorted. In each pass, you are picking up one element from the unsorted list and placing it in its proper position in the 1, Selection sort You are sorting a list using shell sort algorithm. You are grouping the elements separated by a distance of several positions to form multiple sublists. Which of the following sorting algorithm will you apply on each 1, Selection sort

2, 45

3, 55

SBM066

2, Selection sort

3, Insertion sort

SBM067

2, Insertion sort

3, Quick sort

SBM068

2, Insertion sort

3, Bubble sort

SBM069

SBM070

Which of the following sorting algorithms is based on the divide and conquer approach? You are sorting a list using a sorting algorithm. You have selected a pivot from the list and partitioned the list into two parts. Which of the following sorting algorithm works on this type of algorithm? Which of the following Big O notion represents the efficiency of merge sort algorithm? You are sorting a large list of data. You want to use a sorting algorithm which requires same amount of time in best, average, and worst cases. Which of the following sorting algorithm will you use to accomplish Which of the following Big O notation represents the order of growth of bubble sort algorithm? Which of the following sorting algorithm performs maximum of one swap per pass? Which of the following Big O notation represents the best case efficiency of linear search? You are searching a record in a list using linear search. The desired record is found at the last position in the list. Which of the following Big O notation represents the efficiency of linear search in the preceding case? Which of the following statements is NOT true about binary search algorithm? You are searching a name in a telephone directory using binary search. The name has been found at the middlemost position in the list. Which of the following Big O notation represents the efficiency of binary Which of the following statements is NOT true about hashing?

1, Bubble sort

2, Selection sort

3, Insertion sort

1, Selection sort

2, Insertion sort

3, Shell sort

SBM071

1, O (n log n)

2, O (log n)

3, O (n)

SBM072

1, Selection sort

2, Bubble sort

3, Merge sort

SBM073

1, O (log n)

2, O (1)

3, O (n log n)

SBM074

1, Bubble sort

2, Selection sort

3, Insertion sort

SBM075

1, O (1)

2, O (log n)

3, O (n)

SBM076

1, O (1) 1, The worst case efficiency of binary search is O (log n)

SBM077

2, O (n) 2, Binary search algorithm can be used on both, sorted and unsorted list.

3, O (log n) 3, The best case efficiency of binary search is O (1)

SBM078

1, O (1) 1, A hash table is sequentially accessed.

2, O (log n)

SBM079

3, O (n) 3, The conversion of a key to an address is 2, Hashing can result in known as a hashing a collision. function.

SBM080

SBM081

Which of the following hashing technique divides the key value by the size of the hash table to obtain the remainder of the division? 1, Truncation method You are calculating the address of a particular record. At the time of calculation you are dividing the keys into parts and then adding the parts together. Which of the following hashing technique are you using to perform 1, Truncation method

2, Modular method

3, Mid Square method

2, Mid Square method

3, Folding method

SBM082

Which of the following data structure cannot be a dynamic data structure? The next field of the last node in a singly-linked list contains _______. Which of the following statements is NOT true about a singly-linked list?

1, Array 1, The address of the first node.

2, Linked list 2, The address of the previous node.

3, Stack 3, The address of the next node. 3, You can traverse a singly-list in forward direction.

SBM083

SBM084

1, In a singly-linked list, 2, In singly-linked list, each node points to the the last node points to next node. NULL.

1, Product(n) 1. s = n * Product(n 1)

2, Product(n)

3, Product(n)

1. set ctr = 1

1. set ctr = n

2. Return (s)

2. set s = 1

2. set s = 1

3. while (ctr <= n)

3. while (ctr >= 1)

a. s = s * ctr

a. s = s * ctr

SBM085

SBM086

You are creating an algorithm to find the product of the first n natural numbers. Which of the following algorithm represents the correct recursive function to solve the problem? You have written a program based on an algorithm. You want to measure the time efficiency of this algorithm. Which of the following factors is not considered to measure the time efficiency of an 1, Compiler 1, 1. Set CURRENT = LAST.next 2. Set LAST.next = CURRENT.next

b. increment ctr by 1

b. decrement ctr by 1

4. return (s)

4. return (s)

2, Speed of the machine 3, Input data 2, 1. Set CURRENT = LAST.next 3, 1. Set CURRENT = LAST.next

SBM087

Sam has created a circular linked list. The last node of this list is identified as LAST. He wants to delete the first node from the list. Which of the following algorithm will he use to perform this task?

2. Release memory for 2. Set CURRENT.next = the node identified as LAST.next CURRENT

SBM087

Sam has created a circular linked list. The last node of 3. Release memory for this list is identified as LAST. He wants to delete the first node from the list. Which of the following algorithm the node identified as CURRENT will he use to perform this task? Sam wants to sort an array of 10 elements, named arr. He has written the following algorithm:

3. Release memory for the node identified as CURRENT

1. Set I = 1

2. While ( I < 10):

A. Set j = 0

B. While ( j < 10 - I ):

i. If ( arr[I] > arr[j + 1] ):

a. Set temp = arr[j]

b. a[j] = a[j + 1]

c. a[j + 1] = temp

ii. Set j = j + 1

C. Set I = I + 1 Which of the following sorting algorithm is Sam using to sort the array? 1, Bubble sort

SBM088

2, Selection Sort

3, Insertion sort

Sam wants to sort an array of 10 elements, named arr. He has written the following algorithm:

1. Repeat steps 2, 3, 4, and 5 varying i from 1 to 9

2. Set temp = arr[i]

3. Set j = i - 1 4. Repeat until j becomes less than 0 or arr[j] becomes less than or equal to temp:

a. Shift the value at index j to index j + 1

b. Decrement j by 1

5. Store temp at index j + 1 Which of the following sorting algorithm is Sam using to sort the preceding array? 1, Bubble sort

SBM089

2, Selection sort

3, Insertion sort

1, 1. Set i = 1

2, 1. Set i = 1

3, 1. Set i = 0

2. While ( i < 10):

2. While ( i < 10):

2. While (i <= 8):

A. Set j = 0

A. Set j = 0

a. Set min_index = i

B. While ( j < 10 - i ):

B. While ( j < 9 ):

b. Set j = i + 1

i. If ( arr[i] > arr[j + 1] ): a. Set temp = arr[j]

i. If ( arr[i] > arr[j + 1] ): a. Set temp = arr[j]

c. While ( j <= 9): i. If (arr[j] < arr[min_index]):

b. a[j] = a[j + 1] c. a[j + 1] = temp temp

b. a[j] = a[j + 1] c. a[j + 1] =

min_index = j

ii. Set j = j + 1 d. Swap arr[i] with arr[min_index]

ii. Set j = j + 1 Sam wants to sort an array of 10 elements, named arr, using selection sort algorithm. Which of the following algorithms Sam has to write to perform this task? Sam is using hashing techniques to calculate the address of the following key values:

ii. Set j = j + 1

SBM090

C. Set i = i + 1

C. Set i = i + 1.

e. Set i = i + 1

74859

47648

95785

73647 Sam is assuming that the size of the table is 100. Calculate the address of the preceding keys by using the modular method. Sam has created the following algorithm to search an element in arr[10], an array of 10 elements: 1, The addresses of the 2, The addresses of the 3, The addresses of the corresponding key are corresponding key are corresponding key are 39, 4 ,24, 31 59, 48, 85, 47 85, 64, 78, 36

SBM091

1. Read the element to be searched.

2. Set i = 0

3. While ( i < 10 and arr[i] != element)

Set i = i + 1

4. If i = 10:

Display "Not Found"

Else

Display "Found"

The array is containing the following elements:

SBM092

23, 56, 10, 45, 76, 56, 43, 23, 77, 50 Sam wants to search 45 in this list using the preceding algorithm. Analyze and predict how many number of comparisons will be performed to search 45 at the time of execution? 1, 3 1, 1. Read the element to be searched

2, 4 2, 1. Read the element to be searched

3, 10 3, 1. Read the element to be searched

2. Set i = 0

2. Set i = 0

2. Set i = 0

3. Set ctr = 0

3. Set ctr = 0

3. Set ctr = 0

4. While ( i < 10): a. If ( arr[i] = element):

4. While ( i < 10): a. If ( arr[i] = element):

4. While ( i < 10): a. If ( arr[i] = element):

Set ctr = ctr + 1

Set ctr = ctr + 1

Set ctr = ctr + 1

b. Set i = i + 1

b. Set i = i + 1

b. Set i = i + 1

5. If (i = 10)

5. If ( ctr = 0)

5. If ( i > 10)

Display "Not Found" Sam wants to search an element in arr, an array containing 10 elements. In addition, he wants to display the number of times the searched element occurs in the list. Which of the following algorithm will Sam write to perform this task using linear search method?

Display "Not Found"

Display "Not Found"

Else Display "Found", ctr, "Occurrences"

Else Display "Found", ctr, "Occurrences"

Else Display "Found", ctr, "Occurrences"

SBM093

1, 1. Accept the 2, 1. Accept the 3, 1. Accept the element to be searched element to be searched element to be searched

2. Set lower = 0

2. Set lower = 0

2. Set lower = 0

3. Set upper = 19

3. Set upper = 19

3. Set upper = 19

4. Set mid = (lower + upper)/2 5. if arr[mid] = desired element:

4. Set mid = (lower + upper)/2 5. if arr[mid] = desired element:

4. Set mid = (lower + upper)/2 5. if arr[mid] = desired element:

a. Display "Found"

a. Display "Found"

a. Display "Found"

b. Go to step 10 6. If desired element < arr[mid]:

b. Go to step 10 6. If desired element < arr[mid]:

b. Go to step 10 6. If desired element < arr[mid]:

a. Set upper=mid-1 7. If desired element > arr[mid]

a. Set upper=mid-1 7. If desired element > arr[mid]

a. Set upper=mid+1 7. If desired element > arr[mid]

a. set lower=mid+1

a. set lower=mid+1

a. set lower=mid-1

8. If lower<=upper:

8. If lower<=upper:

8. If lower<=upper:

a. Go to step 4 Sam wants to search an element in arr, the array of 20 elements. The array is sorted in ascending order. Sam 9. Display "Not found" wants to develop an algorithm in which, with every step, the search area should reduce to half. Which of the following algorithm will Sam develop to accomplish 10. Exit this task? Sam has developed the following algorithm to search an element in a sorted array:

a. Go to step 5

a. Go to step 4

9. Display "Not found"

9. Display "Not found"

SBM094

10. Exit

10. Exit

1. Accept the element to be searched

2. Set lowerbound = 0

3. Set upperbound = n - 1

4. Set mid = (lowerbound + upperbound)/2

5. If arr[mid] = desired element:

a. Display "Found"

b. Go to step 10

6. If desired element < arr[mid]:

a. Set upperbound = mid - 1

7. If desired element > arr[mid]

a. Set lowerbound = mid + 1

8. If lowerbound <= upperbound:

a. Go to step 4

9. Display "Not Found"

10. Exit

The array is containing the following elements:

SBM095

13, 16, 20, 25, 35, 40, 43, 45, 50, 55 Sam wants to search 45 in this list using the preceding algorithm. Analyze and identify maximum number of comparisons that will be performed to search the element?

1, One 1, 1. Set CURRENT = START 2. While ( CURRENT != NULL) a. Display the information contained by CURRENT b. CURRENT = CURRENT.Next 1, The address of the previous node

2, Five 2, 1. Set CURRENT = START 2. While ( CURRENT != NULL) a. Display the information contained by CURRENT b. CURRENT = CURRENT.Previous 2, The address of the last node

3, Three 3, 1. Set CURRENT = LAST 2. While ( CURRENT != NULL) a. Display the information contained by CURRENT b. CURRENT = CURRENT.Next

SBM096

Sam has created a doubly-linked list. The first node of this list is identified as START and the last node is identified as LAST. Sam wants to traverse the list in backward direction. Which of the following algorithm Sam has to develop to perform this task? The previous field of the first node of a doubly-linked list contains _______. A doubly-linked list contains three nodes A, B, and C. They are sequentially added in the list. These nodes are present in the following memory locations:

SBM097

3, The address of itself

A: 3211

B: 4050

C: 5662 Which of the following value will be stored in the previous field Of the node, C?

SBM098

1, NULL 1, 1. Allocate memory for the newNode

2, 4050 2, 1. Allocate memory for the newNode

3, 5662 3, 1. Assign value to the data field for the newNode

2. Set newNode.Next = 2. Set newNode.Next = 2. Set Start = newNode NULL NULL

3. Set Start = newNode 3. Set Start = newNode You are creating the first node in an empty singlylinked list. Which of the following algorithm will you write to perform this task? Sam is creating a singly-linked list. He wants to insert a node between two nodes in the list. He has allocated memory for the new node and marked it as newNode. He has also identified the nodes between which the new node is to be inserted and marked them as PREV and CURR. Which of the following statements Sam has to 1, 1. Set PREV.Next = write to complete this task? newNode Sam is trying to insert a node at the end of a singlylinked list. The list is not empty. The starting node of the list is identified by START. Sam has allocated memory for the new node and marked it as newNode. 2, 1. Set PREV.Next = newNode 3, 1. Set PREV.Next = newNode

SBM099

SBM100

2. Set newNode.Next = 2. Set CURR = newNode CURR

1. Set CURR = START

2. While ( CURR != NULL )

Set CURR = CURR.Next

3. CURR.Next = newNode

4. newNode.Next = NULL When Sam executed the code, the newNode was not inserted at the end of the list. Identify the reason for node not getting inserted at the end of the list? Which of the following tasks is the first step you need to perform before deleting a node from a single linked list? 1, Step 3 should be CURR = newNode 1, Search the position for the node to be deleted 2, Step 2 should be: While ( CURR.Next != NULL ) 2, Release the memory space for the node 3, Step 3 should be CURR = newNode.Next 3, Check whether the list is empty or not 3, 1. Set START = START.Next 2. Release memory space for START 2, 1. Release memory space for START 2, 1. Set CURRENT = CURRENT.Next 2. Release memory space for the CURRENT 3, 1. Set PREV = CURRENT 2. Release memory space for the CURRENT

SBM101

SBM102

SBM103

You are deleting a node from the beginning of a singlylinked list. The starting node of the list is identified as START. Which of the following algorithm will you use to 1, 1. Set START = perform the delete operation? START.Next Sam is deleting a node between two nodes in a singlylinked list. He has located the node to be deleted. He has marked the node to be deleted as CURRENT, and its predecessor as PREV. Which of the following algorithm Sam has to write to delete the CURRENT node from the singly-linked list? Sam is trying to delete the last node from a singlylinked list. The list is not empty and the first node of the list is identified by START. Sam has written the following algorithm to perform the preceding task: 1, 1. Set PREV.Next = CURRENT.Next 2. Release memory space for the CURRENT

SBM104

1. Set PREV = START

2. Set CURR = START

3. While ( CURR != NULL )

a. Set PREV = CURR

b. Set CURR = CURR.Next

4. set PREV.Next = NULL

5. Release memory space for CURR However, the preceding algorithm does not delete the last node from the list. Identify the reason for this. You are storing student data in a list. For creating the list you are allocating memory dynamically. Which of the following statement holds true for dynamic memory allocation? You are creating a linked list where the last node points to the first node instead of pointing to NULL. Which of the following type of linked list are you creating? Sam is trying to delete a node from a doubly-linked list. Each node of this list has a data field and two address fields, Previous and Next. The first node of the list is identified as START. Sam wants to create an algorithm 1, Step 4 should be PREV = NULL 1, Memory is allocated at run time. 2, Step 4 should be CURR = NULL 2, The chunk of memory is always allocated in a contiguous location. 3, Step 4 should be PREV.Next = CURR.Next 3, The allocated memory size is fixed at compile time.

SBM105

SBM106

SBM107

1, Singly-linked list 1, If the CURR is last node in the list CURR.Next points to NULL, and NULL does

2, Doubly-linked list 2, If the CURR is last node in the list CURR.Next points to NULL, and NULL does

1. Set PREV = NULL

Remove line 7 from the algorithm. Change line 7 : Set CURR.Previous = PREV

3, Circular linked list 3, If the CURR is last node in the list CURR.Next points to NULL, and NULL does Develop a separate algorithm for deleting a node from the end of the list.

2. Set CURR = START 3. Repeat step 4 and 5 until either the node is found or CURR becomes NULL

4. Set PREV = CURR

5. Set CURR = CURR.Next

6. Set PREV.Next = CURR.Next

7. CURR.Next.Previous = PREV

SBM108

8. Release the memory of the node marked as CURR However, the preceding algorithm works in deleting a node between two nodes in a list but does not work in deleting a node from the end of the list. Identify the reason and predict the solution for this. Sam is trying to delete the last node from a circular linked list. Each node of this list has a data field and an address field, Next. The last node in this list is marked as LAST. Sam has developed the following algorithm to

1. Set CURR = LAST

2. Set PREV = LAST.Next

3. While (PREV.Next != LAST)

Set PREV = PREV.Next

4. Set PREV.Next = LAST.Next

5. Set LAST = PREV

6. Release the memory of the node marked as LAST However, the preceding algorithm does not delete the last node from the circular linked list. Analyze the algorithm and identify the solution. 1, Change line 3 as While (PREV != LAST)

SBM109

2, Change line 6 as Release the memory of the node marked as CURR

3, Change line 5 as Set PREV = LAST

SBM110

Sam is developing a software project. He is asked to store employee salary details in a linked list. Sam has implemented a singly linked list and stored the salary details of the employees in ascending order. But after

1, Sam Should create 3, Sam should apply the another singly-linked list sorting algorithm on the to store employee 2, Sam Should create a existing linked list to sot salaries in descending circular linked list. the employee salaries in 1, 1. Set CURR = START 2. Set START = START.Next 2, 1. Set CURR = START 2. Set START = START.Next 3. Set START.Previous = NULL 3, 1. Set CURR = START 2. Set START = START.Next 3. Set START.Previous = NULL 4. Release the memory of the node marked as START

3. If START != NULL Sam is trying to delete the starting node physically from a doubly-linked list. Each node of this list has a data field. In addition, each node has two address fields, Previous and Next. Which of the following algorithm Sam has to write to perform deletion in the beginning of the list? Sam is developing a searching algorithm. He has to search for a record corresponding to a given key value in a list of records. He is using hashing technique to write the searching algorithm. To avoid collision he is Sam is developing a searching algorithm. He has used hashing technique, which is the fastest searching method. His main objective is that the searching algorithm should work ideally with the O(1) efficiency.

4. Release the memory Set of the node marked as START.Previous = NULL CURR 4. Release the memory of the node marked as CURR 1, Sam should use separate chaining method. 2, Sam should use linear probing method.

SBM111

SBM112

3, Sam should use quadratic probing method.

SBM113

2, The hashing function 3, The hash function did 1, Sam has used a poor results improper not returned the same quality hash function. distribution of records. value for all keys.

1, 1. If top = 0 a. Display Sam has created an array to implement a stack. He has declared a "Stack empty" variable, top to store the index b. Exit position of the element in the array that has been pushed last. Which of the following algorithm Sam should use to pop an element from the

2, 1. If top = 0 a. Display "Stack empty" b. Exit

3, 1. If top = -1 a. Display "Stack empty" b. Exit

position of the element in the array that has been pushed last. Which of the following algorithm Sam should use to pop an element from the SBM124 stack? Sam has created an array of 50 elements to implement a stack. He has declared a variable, top to store

2. Retrieve the value stored at the index top 3. Decrement top by 1

2. Retrieve the value stored at the index top 3. Increment top by 1

2. Retrieve the value stored at the index top 3. Decrement top by 1

1. Increment top by 1 2. Store the value to be pushed at index top in the array. algorithm b. Exit However, the preceding throws a runtime error whenever the 2. Increment array is full and the user attempts to top by 1 the 3. Store value to be SBM125 Sam has created a linked list to pushed at index implement a queue. Each of the node 1, 1. If FRONT = in the list has a data field and an NULL a. Display 1. Set CURRENT = FRONT "Queue empty" 2. Set FRONT = FRONT.Next 3. Release memory for the node marked asthe CURRENT However, execution of the preceding algorithm throw a runtime error whenever the user attempts to SBM126

1, I. If top = 50: 2, I. If top = 49: 3, I. If top = 49: a. Display a. Display a. Display "Stack is full" "Stack is full" "Stack is full" b. Exit 2. Increment top by 1 the 3. Store value to be pushed at index 2, 1. If REAR = NULL a. Display "Queue empty" b. Exit 2. Set CURRENT = REAR 3. Set REAR = REAR.Next 4. Release memory for the node marked as b. Exit the 2. Store value to be pushed at index 3. Increment top by 1 3, 1. If REAR != NULL a. Display "Queue empty" b. Exit 2. Set CURRENT = REAR 3. Set REAR = REAR.Next 4. Release memory for the node marked as

b. Exit 2. Set CURRENT = FRONT 3. Set FRONT = FRONT.Next 4. Release memory for the node marked as

Sam has created an array to implement a queue. He has created two variables, FRONT and REAR to store the index positions of the deletion point and insertion point in the array respectively. Which of the following code Sam has to write to implement the insert operation in a SBM127 queue?

1, 1. If the queue is empty: a. Set FRONT = 0 2. Increment REAR bythe 1 3. Store element at index position

2, 1. If the queue is empty: a. Set FRONT =0 2. Increment FRONT 1 3. Storeby the element at index position

3, 1. If the queue is empty: a. Set REAR = 0 2. Increment REAR bythe 1 3. Store element at index position

Sam wants to traverse a graph using Depth First Traversal algorithm. Which of the following algorithm Sam SBM133 has to develop to perform this task?

1, 1. Push the starting vertex, v the until stack. 2.into Repeat the stack becomes empty: a. Pop a vertex from the stack. b. Visit the popped vertex.

2, 1. Push the starting vertex, v the until stack. 2.into Repeat the stack becomes empty: a. Pop a vertex from the stack. b. Push all the unvisited vertices

3, 1. Push the starting vertex, v into the stack. 2. Pop a vertex from the stack. 3. Visit the popped vertex. 4. Push all the unvisited vertices

Depth First Traversal algorithm. c. Push all the Which of the following algorithm Sam unvisited c. Visit the SBM133 has to develop to perform this task? vertices popped vertex.

SBM137

2. Traverse the 2. Visit the root left subtree 3. Traverse the 3. Traverse the right subtree right subtree

2. Traverse the right subtree 3. Visit the root

Click the exhibit button. Sam has 1, The node 2, The node 3, The node inserted a new node in a balanced containing value containing value containing value SBM142 binary tree. The button. newly inserted node 11 15 17 3, 1.Sam has to Click the exhibit The given perform a tree is a balanced binary search tree. double rotation Sam has inserted a node in this tree a. Rotate right that has a value, 55. After inserting 1, Sam has to 2, Sam has to the node the tree becomes perform a single perform a single around node 60 unbalanced. Which of the following left rotation right rotation b. Rotate left SBM143 actions Sam has to perform to restore around node the 50 around node the 55 around node the 50 1, 1. Identify 2, 1. Identify 3, 1. Identify node for which node for which node for which you to you to you to 2. If need the left 2. If need the left 2. If need the right child of child of child of currentNode is a currentNode a. Mark the is a currentNode a. Mark the left a. Mark the is a right child of child of right child of currentNode as currentNode as currentNode as b. Make Exit. 3. currentNode point to its right 4. Repeat step 5 Sam has created a threaded binary until the left tree. He wants to implement the of 5. Make traversal of this tree with the help of child currentNode threads. Which of the following point to its left algorithm Sam should develop to 6. Mark locate the inorder successor of a node currentNode as SBM144 in a threaded binarythe tree? successor. Sam has developed following algorithm to convert an infix expression to a postfix expression: b. Make Exit. 3. currentNode point to its right 4. Repeat step 5 until the left child of 5. Make currentNode point to its left 6. Mark currentNode as successor. b. Make Exit. 3. currentNode point to its left 5 4. Repeat step until the left child of 5. Make currentNode point to its left 6. Mark currentNode as successor.

1. Initialize the stack to be empty. 2. Initialize the postfix string to be empty. 3. Scan the entries in the infix expression from left to right until the end of the infix expression is a. If the scanned entry is: i. An operand: Append the operand to the postfix string. the ii. An operator: Compare precedence of the operator with the operator on the top of the stack. If iii. A left parenthesis: Push the left parenthesis onto the stack. Iv. A right parenthesis: Pop stack elements one by one and append them the postfix string aand left 4. Popto all entries from theuntil stack append them to the postfix expression.

2, The given algorithm will not give the 1, The given desired output Analyze the preceding algorithm and algorithm will because step identify whether it will give the give the desired 3(a)(ii) is SBM145 desired output. output. 1, 1. Add 'a' to incorrect. 2, 1. Add 'a' to Sam is converting the following infix the postfix the postfix expression to postfix expression: string. string. 2. Push '+' into 2. Push '+' into a+b*c-d the stack. the stack.

3, The given algorithm will not give the desired output because step 3(a)(i) is incorrect. 3, 1. Add 'a' to the postfix string. 2. Push '+' into the stack.

Which of the following options is the 3. Add 'b' to the correct postfix expression? postfix string. 4. Push '*' into the stack. 5. Add 'c' to the Postfix string. 6. Pop '*' from the stack and add to '+' the 7. Pop from the stack and add to the 8. Push '-' into the stack. 9. Add 'd' to the postfix 10. Popstring. '-' from the stack and SBM146 add to the

3. Add 'b' to the postfix string. 4. Push '*' into the stack. 5. Add 'c' to the Postfix string. 6. Pop '*' from the stack and add to '+' the 7. Pop from the stack and add to the 8. Add 'd' to the postfix string. 9. Push '-' into the stack. 10. Pop '-' from the stack and add to the

3. Add 'b' to the postfix string. 4. Push '*' into the stack. 5. Add 'c' to the Postfix string. 6. Pop '+' from the stack and add to '*' the 7. Pop from the stack and add to the 8. Push '-' into the stack. 9. Add 'd' to the postfix 10. Popstring. '-' from the stack and add to the

Sam is implementing a queue using an 1, Sam has to array. In the algorithm, there are two change the SBM149 variables, FRONT and REAR to store algorithm in

2, Sam has to 3, Sam has to use Linked list implement the instead of array. queue in the

XX
4, XML

X X
4

4, Object models

4, Object models

4, Object models

4, Object models

4, Object models

4, Object models

4, Object models 4, <?xml version="1.0"?> 4, <?xml version="1.0"?> 4, <?xml version="1.0"?> 4, <?xml version="1.0"?>

4, <?xml version="1.0"?> 4, <?xml version="1.0"?> 4, The namespace is a string that uniquely identifies the elements and attributes from

4, name 4, The include element allows you to access components from multiple schemas that

4, all

4, text-indent 4, Can reorder, add, or delete elements

4, *

4, PRICE &&gt;= 20

4, Table

4, NodeList object

4, parseError

4, MM/DD

4, NamespaceURI()

4, XMLSchemaCache 4, var namespace=xmlDoc.doc umentElement.namespa ceURI; xmlDoc.validateOnParse =true; var xsdschemacache = new ActiveXObject("Msxml2. XMLSchemaCache.6.0") xsdschemacache.add(na mespace,document.frm Transform.

TxtXSDFileName); xmlDoc.schemas=xsdsc hemacache; xmlDoc.load(document.f rmTransform.TxtXMLFile Name); 4, The number of parameters passed to the createNode method is incorrect. The correct

var docobj = new ActiveXObject("Msxml2. DOMDocument.6.0");

docobj.async=false; if (docobj.childNodes.leng th==0)

{ myroot=docobj.createN ode(1,"Product",""); docobj.appendChild(myr oot); docobj.save("d:\Prod.x ml");

4 4, var myxmldoc=new ActiveXObject("Msxml2. DOMDocument.6.0");

var i;

myxmldoc.async=false; myxmldoc.load("C:\\em p.xml"); if (myxmldoc.readyState == 2 && myxmldoc.parseError.e

{ var root=myxmldoc.docume ntElement; for (i=0; i< root.childNodes.length; ++ i)

{ alert (root.childNodes.item(i). xml);

else

{ alert("Failed to load the document. Check whether your XML document is well-

4, <xsl:value-of select='(PRICE) * sum(ORDER/QUANTITY) ' />

4, number(obj?) 4, <xsl:if select="PRICE [. = 500]" /> 4, var xslprocobj=createProces sor(); 4, <xsl:stylesheet xmlns:xsl="http://www. w3.org/1999/XSL/Trans form" version="1.0"> <xsl:template match="/">

<html>

<body> <xsl:for-each select="PRODUCTDATA/ PRODUCT"> <li><xsl:valu e-of select="PRODUCTNAME "/></li> <li><xsl:valu e-of select="DESCRIPTION"/ ></li>

<li><xsl:valu e-of select="QUANTITY"/>< /li> <li><xsl:valu e-of select="PRICE"/></li>

<br></br>

</xsl:for-each>

</body>

</html>

</xsl:template>

</xsl:stylesheet>

4, <xsl:stylesheet xmlns:xsl="http://www. w3.org/1999/XSL/Trans form" version="1.0"> <xsl:template match="/">

<html>

<body> <xsl:for-each select="CUSTDETAILS/ CUSTOMER"> <li><xsl:value-of select="@CUSTID"></li >

<li><xsl:value-of select="CUSTNAME">< /li> <li><xsl:value-of select="ADDRESS"/></ li> <li><xsl:value-of select="CITY"></li> <li><xsl:value-of select="STATE"></li> <li><xsl:value-of select="COUNTRY"></li > <li><xsl:value-of select="PHONE"></li>

<br></br>

</xsl:for-each>

</body>

</html>

</xsl:template>

</xsl:stylesheet>

4, CGI

4, link

4, defaultStatus

4, location

4, <td>

4, <u>

4, <HEAD>

4, <HTML>

<BODY> <IMG SRC="image.gif" USEMAP="#map_sectio n"> <MAP NAME="down_map"> <AREA Name="exit" SHAPE="rect" HREF="image.gif">

</BODY>

</HTML> 4, <xsd:simpleType name="Price"> <xsd:maxInclusive value="400"></xsd:ma xInclusive> <xsd:minInclusive value="10"></xsd:minI nclusive>

</xsd:simpleType>

4, <xsd:schema xmlns:xsd="http://www .w3.org/2001/XMLSche ma">

<xsd:attribute name="PRODID" type="pID" use="required"/> <xsd:simpleType name="pID"> <xsd:restriction base="xsd:string"> <xsd:pattern value="[P]{1}\d{3}"/ >

</xsd:restriction>

</xsd:simpleType>

</xsd:schema>

4, A start tag can contain two attributes with the same name, regardless of whether or

4, xmlns keyword associates a prefix with a namespace URI

4, <xsd:group> 4, <xsd:schema xmlns:xsd="http://www .w3.org/2001/XMLSche ma"> <xsd:element name="EMPLOYEE" type="emptype" /> <xsd:complexType name="emptype">

<xsd:sequence> <xsd:element name="FIRSTNAME" type="xsd:string"/> <xsd:element name="LASTNAME" type="xsd:string"/> <xsd:element name="DESIG" type="xsd:string"/>

<xsd:element name="DEPARTMENT" type="xsd:string"/>

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

2 4, <schema xmlns="http://www.w3. org/2001/XMLSchema" targetNamespace="ww w.ecomatcybershop.co m" xmlns:prd="www.ecom <include schema="potype.xsd"/ > <element name="PURCHASEORD ER" type="prd:purord"/> <complexType name="purord">

<sequence> <element name="ORDER" type="prd:ord"/>

</sequence> <attribute name="PRODID" type="prd:prstring"/> <attribute name="ORDERID" type="prd:orstring" use="required"/>

</complexType> <complexType name="ord">

<sequence>

</sequence>

</complexType>

</schema>

4, Ordered list

4, Statement A is false, B is true

4, Web structure 4, 1. Register a domain name

2. Choose the Services 3. Upload the files on the Web Server

4. Test the Web site

4, scriptEngine()

4, Streaming is a protocol developed by Netscape for transmitting private 4, <TABLE WIDTH="5"> <TR><TD>Joe</TD>< TD>Martin</TD></TR>

</TABLE>

4, He should have reused the schema by using the import statement.

4, xmlDoc

4, Effectiveness 4, An algorithm has five important properties: Finiteness, Definiteness, Input, Output, and

4, Linked list

4, Queue 4, This approach combines the solutions to the subproblems to solve the original 4, Factorial of a given number can be calculated by using recursion.

4, O (n log n)

4, Heap sort

4, 24

4, 44

4, Quick sort

4, Merge sort

4, Merge sort

4, Quick sort

4, Quick sort

4, O (1)

4, Quick sort

4, O (n2)

4, Shell sort

4, O (n log n)

4, O (n log n) 4, In binary search algorithm, with every step, the search are is reduced to half.

4, O (n log n) 4, Using hashing, the desired record could easily be retrieved in a single disk access.

4, Folding method

4, Modular method

4, Queue

4, The NULL value. 4, You can traverse a singly-list in backward direction.

4, Product(n)

1. if (n = 1)

return (1) 2. s = n * Product(n 1)

3. Return (s)

4, Output data 4, 1. Set CURRENT = LAST.next 2. Set CURRENT= CURRENT.next

3. Release memory for the node identified as CURRENT

4, Quick sort

4, Quick sort

4, 1. Set i = 0

2. While (i <= 9):

a. Set min_index = i

b. Set j = i + 1

c. While ( j <= 10): i. If (arr[j] < arr[min_index]):

min_index = j

ii. Set j = j + 1 d. Swap arr[i] with arr[min_index]

e. Set I = I + 1

4, The addresses of the corresponding key are 9, 8, 5, 7

4, 9 4, 1. Read the element to be searched

2. Set i = 0 4. While ( i < 10 and arr[i] = element)

Set i = i + 1

5. If (i = 10)

Display "Not Found"

Else

Display "Found"

2 4, 1. Accept the element to be searched

2. Set lower = 0

3. Set upper = 19

4. Set mid = (lower + upper)/2 5. if arr[mid] = desired element:

a. Display "Found"

b. Go to step 10 6. If desired element < arr[mid]:

a. Set upper=mid-1 7. If desired element > arr[mid]

a. set lower=mid+1

8. Display "Not found"

9. Exit

4, Eight 4, 1. Set CURRENT = LAST 2. While ( CURRENT != NULL) a. Display the information contained by CURRENT b. CURRENT = CURRENT.Previous

4, The NULL value

4, 3211 4, 1. Allocate memory for the newNode 2. Assign value to the data field of the newNode 3. Set newNode.Next = NULL

4. Set Start = newNode 4, 1. Set PREV.Next = newNode

2. Set newNode = CURR 4, Step 3 should be removed Step 4 should be newNode = CURR

2 4, Reposition the Start variable to the next node in the sequence

4, 1. Set TEMP = START 2. Set START = START.Next 3. Release memory space for TEMP 4, 1. Set PREV = CURRENT.Next 2. Release memory space for the CURRENT

4, Step 3 should be While ( CURR.Next != NULL ) 4, If you know the address of the first element, you can calculate the address of 4, Doubly circular linked list 4, If the CURR is last node in the list CURR.Next points to NULL, and NULL does

Change line 7:

If (CURR.Next != NULL) Set CURR.Next.Previous = PREV

4, Change line 6 as Release the memory of the node marked as PREV

4, Sam should create a doubly-linked list so that it could be traversed in both 4, 1. Set CURR = START 2. Set START = START.Next

3. If START != NULL Set START.Previous = NULL

1 4, Sam should use double hashing method. 4, Because of collision, the efficiency of hashing is reduced.

4, 1. If top = -1 a. Display "Stack empty" b. Exit

2. Retrieve the value stored at the index top 3. Increment top by 1 3 4, 1. Increment top by 1 the 2. Store value to be pushed at index 3. If top = 50: a. Display "Stack is full" b. Exit 2 4, 1. If FRONT != NULL a. Display "Queue empty" b. Exit 2. Set CURRENT = FRONT 3. Set FRONT = FRONT.Next 4. Release memory for the node marked as 1

4, 1. If the queue is empty: a. Set FRONT =0 2. Increment REAR bythe 1 3. Store element at index position 4

4, 1. Push the starting vertex, v into the stack. 2. Pop a vertex from the stack. 3. Repeat until the stack becomes empty: a. Visit the popped vertex. 1

b. Push all the unvisited vertices 1

2. Traverse the left subtree 3. Visit the root 1

4, The node containing value 191.Sam has to 3 4, perform a double rotation a. Rotate right around node 55 b. Rotate left around node the 60 3 4, 1. Identify node for which you to 2. If need the right child of currentNode a. Mark the is a right child of currentNode as b. Make Exit. 3. currentNode point to its right 4. Repeat step 5 until the left child of 5. Make currentNode point to its left 6. Mark currentNode as successor. 4

4, The given algorithm will not give the desired output because step 3(a)(iii) is incorrect. 4, 1. Add 'a' to the postfix string. 2. Push '+' into the stack.

3. Add 'b' to the postfix string. 4. Push '*' into the stack. 5. Add 'c' to the Postfix string. 6. Pop '*' from the stack and add to the 7. Push '-' into the stack. 8. Pop '+' from the stack and add to the 9. Add 'd' to the postfix 10. Popstring. '-' from the stack and add to the 1

4, Sam has to use stack instead of

S-ar putea să vă placă și