CS2255 DATABASE MANAGEMENT SYSTEMS (2marks and 16 Marks) Unit-I Part-A
CS2255 DATABASE MANAGEMENT SYSTEMS (2marks and 16 Marks) Unit-I Part-A
1. Define database management system? Database management system (DBMS) is a collection of interrelated data and aSet of programs to access those data. 2. List few applications of DBMS. a) Banking b) Airlines c) Universities d) Credit card transactions e) Tele communication f) Finance g) Sales h) Manufacturing i) Human resources 3. What are the disadvantages of file processing system? The disadvantages of file processing systems are a) Data redundancy and inconsistency b) Difficulty in accessing data c) Data isolation d) Integrity problems e) Atomicity problems f) Concurrent access anomalies 4. What are the advantages of using a DBMS? The advantages of using a DBMS are a) Controlling redundancy b) Restricting unauthorized access c) Providing multiple user interfaces d) Enforcing integrity constraints. e) Providing back up and recovery 5. Give the levels of data abstraction? a) Physical level b) logical level c) view level 6. Define instance and schema? Instance: Collection of data stored in the data base at a particular moment is called an Instance of the database. Schema: The overall design of the data base is called the data base schema. 7. Define the terms 1) physical schema 2) logical schema. Physical schema: The physical schema describes the database design at the physical level, which is the lowest level of abstraction describing how the data are actually stored. Logical schema: The logical schema describes the database design at the logical level, which describes what data are stored in the database and what relationship exists among the data.
8. What is conceptual schema? The schemas at the view level are called subschemas that describe different views of the database. 9. Define data model? A data model is a collection of conceptual tools for describing data, data relationships, data semantics and consistency constraints. 10. What is storage manager? A storage manager is a program module that provides the interface between the low level data stored in a database and the application programs and queries submitted to the system. 11. What are the components of storage manager? The storage manager components include a) Authorization and integrity manager b) Transaction manager c) File manager d) Buffer manager 12. What is the purpose of storage manager? The storage manager is responsible for the following a) Interaction with he file manager b) Translation of DML commands in to low level file system commands c) Storing, retrieving and updating data in the database 13. List the data structures implemented by the storage manager. The storage manager implements the following data structure a) Data files b) Data dictionary c) indices 14. What is a data dictionary? A data dictionary is a data structure which stores meta data about the structure of the database ie. the schema of the database. 15. What is an entity relationship model? The entity relationship model is a collection of basic objects called entities and relationship among those objects. An entity is a thing or object in the real world that is distinguishable from other objects. 16. What are attributes? Give examples. An entity is represented by a set of attributes. Attributes are descriptive properties possessed by each member of an entity set. Example: possible attributes of customer entity are customer name, customer id, customer street, customer city. 17. What is relationship? Give examples A relationship is an association among several entities. Example: A depositor relationship associates a customer with each account that he/she has.
18. Define the terms i) Entity set ii) Relationship set Entity set: The set of all entities of the same type is termed as an entity set. Relationship set: The set of all relationships of the same type is termed as a relationship set. 19. Define single valued and multivalued attributes. Single valued attributes: attributes with a single value for a particular entity are called single valued attributes. Multivalued attributes: Attributes with a set of value for a particular entity are called multivalued attributes. 20. What are stored and derived attributes? Stored attributes: The attributes stored in a data base are called stored attributes. Derived attributes: The attributes that are derived from the stored attributes are called derived attributes. 21. What are composite attributes? Composite attributes can be divided in to sub parts. 22. Define null values. In some cases a particular entity may not have an applicable value for an attribute or if we do not know the value of an attribute for a particular entity. In these cases null value is used. 23. Define the terms i) Entity type ii) Entity set Entity type: An entity type defines a collection of entities that have the same attributes. Entity set: The set of all entities of the same type is termed as an entity set. 24. What is meant by the degree of relationship set? The degree of relationship type is the number of participating entity types. 25. Define the terms i) Key attribute ii) Value set Key attribute: An entity type usually has an attribute whose values are distinct from each individual entity in the collection. Such an attribute is called a key attribute. Value set: Each simple attribute of an entity type is associated with a value set that specifies the set of values that may be assigned to that attribute for each individual entity. 26. Define weak and strong entity sets? Weak entity set: entity set that do not have key attribute of their own are called weak entity sets. Strong entity set: Entity set that has a primary key is termed a strong entity set. 27. What does the cardinality ratio specify? Mapping cardinalities or cardinality ratios express the number of entities to which another entity can be associated. Mapping cardinalities must be one of the following: One to one One to many
Many to one Many to many 28. Explain the two types of participation constraint? Total: The participation of an entity set E in a relationship set R is said to be total if every entity in E participates in at least one relationship in R. Partial: if only some entities in E participate in relationships in R, the participation of entity set E in relationship R is said to be partial. 29. Define the terms i) DDL ii) DML DDL: Data base schema is specified by a set of definitions expressed by a special language called a data definition language. DML: A data manipulation language is a language that enables users to access or manipulate data as organized by the appropriate data model. 30. Write short notes on relational model? The relational model uses a collection of tables to represent both data and the relationships among those data. The relational model is an example of a record based model. 31. Define tuple and attribute Attributes: column headers Tuple: Row 32. Define the term relation. Relation is a subset of a Cartesian product of list domains. 33. Define tuple variable Tuple variable is a variable whose domain is the set of all tuples. PART B 1. What are various components of Database System ? Explain in detail. 2. What do you mean by data models ? Explain network, hierarchical and relational model in detail. 3. Explain various levels of Data abstraction in database system ? 4. What do you mean by database ? What is the purpose of a database system ? Explain. 5. What do you mean by DBMS ? Explain its functioning. 6. Explain architecture of DBMS and its advantages ? state two main disadvantages of DBMS ? 7. What is DBA ? What are major responsibilities of DBA and database designers ? 8. What are problems with traditional file processing system ? How they are removed in database system ? Explain 9. What do you mean by Entity-Relationship Diagram ? Explain 10.Explain the various terms of an E-R model and how are they represented in an E-R model 11.Describe the three-level architecture of DBMS ? Also explain its importance in a database environment. 12. Discuss concept of database language and interfaces 13. Explain the architecture of DBMS with a neat block diagram 14. Explain ER model in detail 15. Explain the design issues of ER-model 16. Explain the various relational algebra operations 17. Draw an ER diagram for a banking enterprise
UNIT-II PART-A 1. What are the parts of SQL language? The SQL language has several parts: data -definitition language Data manipulation language View definition Transaction control Embedded SQL Integrity Authorization 2. What are the categories of SQL command? SQL commands are divided in to the following categories: 1. data -definitition language 2. data manipulation language 3. Data Query language 4. data control language 5. data administration statements 6. transaction control statements 3. What are the three classes of SQL expression? SQL expression consists of three clauses: Select From where 4. Give the general form of SQL query? Select A1, A2., An From R1, R2, Rm Where P 5. What is the use of rename operation? Rename operation is used to rename both relations and a attributes. It uses the as clause, taking the form: Old-name as new-name 6. Define tuple variable? Tuple variables are used for comparing two tuples in the same relation. The tuple Variables are defined in the from clause by way of the as clause. 7. List the string operations supported by SQL? 1) Pattern matching Operation 2) Concatenation 3) Extracting character strings 4) Converting between uppercase and lower case letters. 8. List the set operations of SQL? 1) Union 2) Intersect operation 3) The except operation 9. What is the use of Union and intersection operation? Union: The result of this operation includes all tuples that are either in r1 or in r2 5
or in both r1 and r2.Duplicate tuples are automatically eliminated. Intersection: The result of this relation includes all tuples that are in both r1 and r2. 10. What are aggregate functions? And list the aggregate functions supported by SQL? Aggregate functions are functions that take a collection of values as input and return a single value. Aggregate functions supported by SQL are Average: avg Minimum: min Maximum: max Total: sum Count: count 11. What is the use of group by clause? Group by clause is used to apply aggregate functions to a set of tuples.The attributes given in the group by clause are used to form groups.Tuples with the same value on all attributes in the group by clause are placed in one group. 12. What is the use of sub queries? A sub query is a select-from-where expression that is nested with in another query. A common use of sub queries is to perform tests for set membership, make setcomparisions, and determine set cardinality. 13. What is view in SQL? How is it defined? Any relation that is not part of the logical model, but is made visible to a user as a virtual relation is called a view. We define view in SQL by using the create view command. The form of the create view command is Create view v as <query expression> 14. What is the use of with clause in SQL? The with clause provides a way of defining a temporary view whose definition is available only to the query in which the with clause occurs. 15. List the table modification commands in SQL? Deletion Insertion Updates Update of a view 16. List out the statements associated with a database transaction? Commit work Rollback work 17. What is transaction? Transaction is a unit of program execution that accesses and possibly updated various data items. 18. List the SQL domain Types? SQL supports the following domain types. 1) Char(n) 2) varchar(n) 3) int 4) numeric(p,d) 5) float(n) 6) date. 6
19. What is the use of integrity constraints? Integrity constraints ensure that changes made to the database by authorized users do not result in a loss of data consistency. Thus integrity constraints guard against accidental damage to the database. 20. Mention the 2 forms of integrity constraints in ER model? Key declarations Form of a relationship 21. What is trigger? Triggers are statements that are executed automatically by the system as the side effect of a modification to the database. 22. What are domain constraints? A domain is a set of values that may be assigned to an attribute .all values that appear in a column of a relation must be taken from the same domain. 23. What are referential integrity constraints? A value that appears in one relation for a given set of attributes also appears for a certain set of attributes in another relation. 24. What is assertion? Mention the forms available. An assertion is a predicate expressing a condition that we wish the database always to satisfy. Domain integrity constraints. Referential integrity constraints 25. Give the syntax of assertion? Create assertion <assertion name>check<predicate> 26. What is the need for triggers? Triggers are useful mechanisms for alerting humans or for starting certain tasks automatically when certain conditions are met. 27. List the requirements needed to design a trigger. The requirements are Specifying when a trigger is to be executed. Specify the actions to be taken when the trigger executes. 28. Give the forms of triggers? The triggering event can be insert or delete. For updated the trigger can specify columns. The referencing old row as clause The referencing new row as clause The triggers can be initiated before the event or after the event. 29. What does database security refer to? Database security refers to the protection from unauthorized access and malicious destruction or alteration.
30. List some security violations (or) name any forms of malicious access. Unauthorized reading of data Unauthorized modification of data Unauthorized destruction of data. 31. List the types of authorization. Read authorization Write authorization Update authorization Drop authorization 32. What is authorization graph? Passing of authorization from one user to another can be represented by an authorization graph. 33. List out various user authorization to modify the database schema. Index authorization Resource authorization Alteration authorization Drop authorization 34. What are audit trails? An audit trail is a log of all changes to the database along with information such as which user performed the change and when the change was performed. 35. Mention the various levels in security measures. Database system Operating system Network Physical human 36. Name the various privileges in SQL? Delete Select Insert update 37. Mention the various user privileges. All privileges directly granted to the user or role. All privileges granted to roles that have been granted to the user or role. 38. Give the limitations of SQL authorization. The code for checking authorization becomes intermixed with the rest of the application code. Implementing authorization through application code rather than specifying it declaratively in SQL makes it hard to ensure the absence of loopholes. 39. Define the term Domain. For each attribute there is a set of permitted values called the domain of that attribute. 8
40. What is a candidate key? Minimal super keys are called candidate keys. 41. What is a primary key? Primary key is chosen by the database designer as the principal means of identifying an entity in the entity set. 42. What is a super key? A super key is a set of one or more attributes that collectively allows us to identify uniquely an entity in the entity set. 43. Define-relational algebra. The relational algebra is a procedural query language. It consists of a set of operations that take one or two relation as input and produce a new relation as output. 44. What is a SELECT operation? The select operation selects tuples that satisfy a given predicate. We use the lowercase letter sssss to denote selection. 45. What is a PROJECT operation? The project operation is a unary operation that returns its argument relation with certain attributes left out. Projection is denoted by pie (p pppp). 46. Write short notes on domain relational calculus The domain relational calculus uses domain variables that take on values from an attribute domain rather than values for entire tuple. 47. Define query language? A query is a statement requesting the retrieval of information. The portion of DML that involves information retrieval is called a query language. 48. Give some encryption techniques? DES AES Public key encryption 49. What does authentication refer? Authentication refers to the task of verifying the identity of a person. 50. List some authentication techniques. Challenge response scheme Digital signatures Nonrepudiation PART B 1.What is meant by term relationship between entities ? Explain the different types of relationships that can exist with examples ? 2.Explain the concept of dependent entities ? give example. 3.What do you mean by mapping cardinalities ? Explain various type of cardinalities. 4.What is difference between total and partial participation ? Explain. 9
5.What is the difference b/w single and multivalued attributes ? Explain. 6. What do you mean by Null values? Explain with suitable examples. 7.Discuss the various update operation on relation and types of integrity constraints that must be checked for each update operation ? 8. What is relational algebra ? Discuss the various operations of relational algebra. 9. Describe the different types of relational calculus in detail. 10.What dis relational calculus ? Differentiate relational algebra and relational calculus. 11.What do you understand by distributed databases? Give the various advantages and disadvantages of distributed database management system. 12. Explain the architecture of Client-Server databases in detail. 13. What are the main differences between a parallel and a distributed system ? Explain 14. Explain nested Queries with examples 15. Explain embedded SQL in detail 16.Explain the integrity constraints supported by SQL 17.Explain triggers with example. 18.Explain security and authorization and Security in SQL 19.Explain dynamic SQL in detail 20. Explain distributed Database in detail 21. Explain CSDB in detail
UNIT-III PART A 1. Define Boyce codd normal form A relation schema R is in BCNF with respect to a set F of functional +dependencies if, for all functional dependencies in F of the form 2. List the disadvantages of relational database system Repetition of data Inability to represent certain information. 3. What is first normal form? The domain of attribute must include only atomic (simple, indivisible) values. 4. What is meant by functional dependencies? Consider a relation schema R and a C R and C R. The functional dependency a holds on relational schema R if in any legal relation r(R), for all pairs of tuples t1 and t2 in r such that t1 [] =t1 [], and also t1 [[1]] =t2 [[1]]. 5. What are the uses of functional dependencies? To test relations to see whether they are legal under a given set of functional dependencies. To specify constraints on the set of legal relations.
10
6. Explain trivial dependency? Functional dependency of the form a is trivial if C Trivial functional dependencies are satisfied by all the relations. 7. What are axioms? Axioms or rules of inference provide a simpler technique for reasoning about functional dependencies. 8. What is meant by computing the closure of a set of functional dependency? The closure of F denoted by F+ is the set of functional dependencies logically implied by F. 9. What is meant by normalization of data? It is a process of analyzing the given relation schemas based on their Functional Dependencies (FDs) and primary key to achieve the properties Minimizing redundancy Minimizing insertion, deletion and updating anomalies. 10. Define canonical cover? A canonical cover Fc for F is a set of dependencies such that F logically implies all dependencies in FC and Fc logically implies all dependencies in F. Fc must have the following properties. 11. List the properties of canonical cover. Fc must have the following properties. No functional dependency in Fc contains an extraneous attribute. Each left side of a functional dependency in Fc is unique. 12. Explain the desirable properties of decomposition. Lossless-join decomposition Dependency preservation Repetition of information 13. What is 2NF? A relation schema R is in 2NF if it is in 1NF and every non-prime attribute A in R is fully functionally dependent on primary key. 14.Define 1NF Tabular format in which: All key attributes are defined There are no repeating groups in the table All attributes are dependent on primary key All relational tables must satisfy 1NF requirements 15. How to convert to First Normal Form A table in a relational database must be in 1NF. Repeating groups must be eliminated Primary key determined 11
Uniquely identify attribute values (rows) All attributes dependent on primary key In example: Combination of PROJ_NUM and EMP_NUM 16.What is Dependency diagram? Dependency diagram: Depicts all dependencies found within a given table structure Helpful in getting birds-eye view of all relationships among a tables attributes Use makes it much less likely that an important dependency will be overlooked 17.What are the Desirable dependencies based on entire primary key Partial: Based on part of composite primary key Transitive: One nonprime attribute depends on another nonprime attribute 18.What are the aspects to be considered to check Table is in second normal form (2NF)? Table is in second normal form (2NF) if: It is in 1NF and It includes no partial dependencies: No attribute is dependent on only a portion of the primary key 19.Define Physical Data Independence: The execution of application programs is not affected by the changes in the physical data access and storage methods. 20.Define Logical Data Independence: Logical changes in tables and views such as adding/deleting columns or changing field length need not necessiatitate modifications in the programs. The database can change and grow to reflect changes in reality without requiring the user intervention or changes in the applications. PART-B 1. Discuss concept of database language 2. Discuss about database interfaces. 3. What is relationship ? What are various types of relationship ? Explain with example. 4. Explain the Codds Rule in detail. 5. What do you mean by RDBMS ? What are its characteristics ? 6. Explain Entity integrity and Referential integrity in detail. 7. What is the difference between DBMS and RDBMS ? Which of them is more suitable? 8. What is relational algebra ? Discuss the various operations of relational algebra. 9. Describe the different types of relational calculus in detail. 10.What dis relational calculus ? Differentiate relational algebra and relational calculus. 11. What do you mean by Null values? Explain with suitable examples. 12. Why normalization needed ? What are its disadvantages ? 13..Discuss the various normal form in normalization with suitable examples. 14. Define term anomalies.Explain BCNF in detail. 15.What do you mean by BCNF ? Why it is used and how it differ from 3 NF ? 16. Explain the different normal forms in detail 17.Explain Functional dependency and Trivial functional dependency with examples. 18.Explain Fourth normal forms with examples. 19.Explain Closure of Set of Functional dependency and Closure of Attribute sets 12
20.Explain Canonical cover and Extraneous Attributes with examples. 21.Explain BCNF with examples and also state the difference between this from 3NF. 22. Give the various advantages and disadvantages of the network model.how it differ from relational model ? 23.Compare BCNF and 3NF UNIT-IV PART A 1. What is transaction? Collections of operations that form a single logical unit of work are called transactions. 2. What are the two statements regarding transaction? The two statements regarding transaction of the form: .Begin transaction .End transaction 3. What are the properties of transaction? The properties of transactions are: .Atomicity .Consistency .Isolation .Durability 4. What is recovery management component? Ensuring durability is the responsibility of a software component of the base system called the recovery management component. 5. When is a transaction rolled back? Any changes that the aborted transaction made to the database must be undone. Once the changes caused by an aborted transaction have been undone, then the transaction has been rolled back. 6. What are the states of transaction? The states of transaction are . Active . Partially committed . Failed . Aborted .Committed .Terminated 7. What is a shadow copy scheme? It is simple, but efficient, scheme called the shadow copy schemes. It is based on making copies of the database called shadow copies that one transaction is active at a time. The scheme also assumes that the database is simply a file on disk. 8. Give the reasons for allowing concurrency? The reasons for allowing concurrency is if the transactions run serially, a short transaction may have to wait for a preceding long transaction to complete, which can lead to unpredictable delays in running a transaction.So concurrent execution reduces the unpredictable delays in running transactions. 13
9. What is average response time? The average response time is that the average time for a transaction to be completed after it has been submitted. 10. What are the two types of serializability? The two types of serializability is . Conflict serializability . View serializability 11. Define lock? Lock is the most common used to implement the requirement is to allow a transaction to access a data item only if it is currently holding a lock on that item. 12. What are the different modes of lock? The modes of lock are: .Shared .Exclusive 13. Define deadlock? Neither of the transaction can ever proceed with its normal execution. This situation is called deadlock. 14. Define the phases of two phase locking protocol . Growing phase: a transaction may obtain locks but not release any lock. .Shrinking phase: a transaction may release locks but may not obtain any new locks. 15. Define upgrade and downgrade? It provides a mechanism for conversion from shared lock to exclusive lock is known as upgrade. It provides a mechanism for conversion from exclusive lock to shared lock is known as downgrade. 16. What is a database graph? The partial ordering implies that the set D may now be viewed as a directed acyclic graph, called a database graph. 17. What are the two methods for dealing deadlock problem? The two methods for dealing deadlock problem is deadlock detection and deadlock recovery. 18. What is a recovery scheme? An integral part of a database system is a recovery scheme that can restore the database to the consistent state that existed before the failure. 19. What are the two types of errors? The two types of errors are: . Logical error . System error
14
20. What are the storage types? The storage types are: . Volatile storage . Nonvolatile storage 21. Define blocks? The database system resides permanently on nonvolatile storage, and is partitioned into fixed-length storage units called blocks. 22. What is meant by Physical blocks? The input and output operations are done in block units. The blocks residing on the disk are referred to as physical blocks. 23. What is meant by buffer blocks? The blocks residing temporarily in main memory are referred to as buffer blocks. 24. What is meant by disk buffer? The area of memory where blocks reside temporarily is called the disk buffer. 25. What is meant by log-based recovery? The most widely used structures for recording database modifications is the log. The log is a sequence of log records, recording all the update activities in the database. There are several types of log records. 26. What are uncommitted modifications? The immediate-modification technique allows database modifications to be output to the database while the transaction is still in the active state. Data modifications written by active transactions are called uncommitted modifications. 27. Define shadow paging. An alternative to log-based crash recovery technique is shadow paging. This technique needs fewer disk accesses than do the log-based methods. 28. Define page. The database is partitioned into some number of fixed-length blocks, which are referred to as pages. 29. Explain current page table and shadow page table. The key idea behind the shadow paging technique is to maintain two page tables during the life of the transaction: the current page table and the shadow page table. Both the page tables are identical when the transaction starts. The current page table may be changed when a transaction performs a write operation. 30. What are the drawbacks of shadow-paging technique? Commit Overhead Data fragmentation Garbage collection 30. Define garbage collection. Garbage may be created also as a side effect of crashes. Periodically, it is necessary to find all the garbage pages and to add them to the list of free pages. This process is called garbage collection. 15
32. Differentiate strict two phase locking protocol and rigorous two phase locking protocol. In strict two phase locking protocol all exclusive mode locks taken by a transaction is held until that transaction commits. Rigorous two phase locking protocol requires that all locks be held until the transaction commits. 33. How the time stamps are implemented Use the value of the system clock as the time stamp. That is a transactions time stamp is equal to the value of the clock when the transaction enters the system. Use a logical counter that is incremented after a new timestamp has been assigned; that is the time stamp is equal to the value of the counter. 34. What are the time stamps associated with each data item? W-timestamp (Q) denotes the largest time stamp if any transaction that executed WRITE (Q) successfully. R-timestamp (Q) denotes the largest time stamp if any transaction that executed READ (Q) successfully. PART B 1. Why is concurrency control needed? Explain lost update, Inconsistent retrievals and uncommitted dependency anomalies. 2. What is a deadlock ? How can a deadlock occur ? explain. 3. Briefly explain one deadlock prevention algorithm. 4. What if time stamping is used ? Explain briefly 5. What is two-phase locking and how does it guarantee serializability ? 6. Discuss the concurrency control mechanism in detail using suitable example. 7. Differentiate between Two phase locking and Rigorous two-phase locking. 8. How can deadlocks be avoided when using 2PL? 9. How Share and exclusive locks differ ?Explain. 10. How precedence graph can be used to detect deadlock ? 11. What is a system log ? What is the purpose of the system log in system recovery 12. Explain serializability 13. Explain lock based protocols 14. Explain two phase locking in detail. 15. Explain log based recovery in detail 16.Explain ACID properties 17.Discuss about recovery UNIT-V 1. Give the measures of quality of a disk. Capacity Access time Seek time Data transfer rate Reliability Rotational latency time. PART A
2. Compare sequential access devices versus random access devices with an example sequential access devices random access devices Must be accessed from the beginning It is possible to read data from any location 16
Eg:-tape storage Eg:-disk storage Access to data is much slower Access to data is faster Cheaper than disk Expensive when compared with disk 3. What are the types of storage devices? Primary storage,Secondary storage,Tertiary storage 4. Draw the storage device hierarchy according to their speed and their cost. Cache Memory Main memory Flash memory Magnetic disk Optical disk Magnetic tapes 5. What are called jukebox systems? Jukebox systems contain a few drives and numerous disks that can be loaded into one of the drives automatically. 6. What is called remapping of bad sectors? If the controller detects that a sector is damaged when the disk is initially formatted, or when an attempt is made to write the sector, it can logically map the sector to a different physical location. 7. Define access time. Access time is the time from when a read or write request is issued to when data transfer begins. 8. Define seek time. The time for repositioning the arm is called the seek time and it increases with the distance that the arm is called the seek time. 9. Define average seek time. The average seek time is the average of the seek times, measured over a sequence of random requests. 10. Define rotational latency time. The time spent waiting for the sector to be accessed to appear under the head is called the rotational latency time. 11. Define average latency time. The average latency time of the disk is one-half the time for a full rotation of the disk. 12. What is meant by data-transfer rate? The data-transfer rate is the rate at which data can be retrieved from or stored to the disk. 13. What is meant by mean time to failure? The mean time to failure is the amount of time that the system could run continuously without failure. 14. What are a block and a block number? A block is a contiguous sequence of sectors from a single track of one platter. Each request specifies the address on the disk to be referenced. That address is in the form of a block number. 15. What are called journaling file systems? File systems that support log disks are called journaling file systems. 17
16. What is the use of RAID? A variety of disk-organization techniques, collectively called redundant arrays of independent disks are used to improve the performance and reliability. 17. Explain how reliability can be improved through redundancy? The simplest approach to introducing redundancy is to duplicate every disk. This technique is called mirroring or shadowing. A logical disk then consists of two physical disks, and write is carried out on both the disk. If one of the disks fails the data can be read from the other. Data will be lost if the second disk fails before the first fail ed disk is repaired. 18. What is called mirroring? The simplest approach to introducing redundancy is to duplicate every disk. This technique is called mirroring or shadowing. 19. What is called mean time to repair? The mean time to failure is the time it takes to replace a failed disk and to restore the data on it. 20. What is called bit-level striping? Data striping consists of splitting the bits of each byte across multiple disks. This is called bit-level striping. 21. What is called block-level striping? Block level striping stripes blocks across multiple disks. It treats the array of disks as a large disk, and gives blocks logical numbers. 22. What are the two main goals of parallelism? Load balance multiple small accesses, so that the throughput of such accesses increases. Parallelize large accesses so that the response time of large accesses is reduced 23. What are the factors to be taken into account when choosing a RAID level? Monetary cost of extra disk storage requirements. Performance requirements in terms of number of I/O operations Performance when a disk has failed. Performances during rebuild. 24. What is meant by software and hardware RAID systems? RAID can be implemented with no change at the hardware level, using only software modification. Such RAID implementations are called software RAID systems and the systems with special hardware support are called hardware RAID systems. 25. Define hot swapping? Hot swapping permits the removal of faulty disks and replaces it by new ones without turning power off. Hot swapping reduces the mean time to repair. 26. Which level of RAID is best? Why? RAID level 1 is the RAID level of choice for many applications with moderate storage requirements and high I/O requirements. RAID 1 follows mirroring and provides 18
best write performance. 27. Distinguish between fixed length records and variable length records? Fixed length records Every record has the same fields and field lengths are fixed. Variable length records File records are of same type but one or more of the fields are of varying size. 28. What are the ways in which the variable-length records arise in database systems? Storage of multiple record types in a file. Record types that allow variable lengths for one or more fields. Record types that allow repeating fields. 29. Explain the use of variable length records. They are used for Storing of multiple record types in a file. Used for storing records that has varying lengths for one or more fields. Used for storing records that allow repeating fields 30. What is the use of a slotted-page structure and what is the information present in the header? The slotted-page structure is used for organizing records within a single block. The header contains the following information. The number of record entries in the header. The end of free space An array whose entries contain the location and size of each record. 31. What are the two types of blocks in the fixed length representation? Define them. Anchor block: Contains the first record of a chain. Overflow block: Contains the records other than those that are the first record of a chain. 32. What is known as heap file organization? In the heap file organization, any record can be placed anywhere in the file where there is space for the record. There is no ordering of records. There is a single file for each relation. 33. What is known as sequential file organization? In the sequential file organization, the records are stored in sequential order, according to the value of a search key of each record. 34. What is hashing file organization? In the hashing file organization, a hash function is computed on some attribute of each record. The result of the hash function specifies in which block of the file the record should be placed. 35. What is known as clustering file organization? In the clustering file organization, records of several different relations are stored in the same file. 36. What is an index? 19
An index is a structure that helps to locate desired records of a relation quickly, without examining all records. 37. What are the two types of ordered indices? . Primary index . Secondary index 38. What are the types of indices? .Ordered indices .Hash indices 39. What are the techniques to be evaluated for both ordered indexing and hashing? .Access types .Access time .Insertion time .Deletion time .Space overhead 40. What is known as a search key? An attribute or set of attributes used to look up records in a file is called a search key. 41. What is a primary index? A primary index is an index whose search key also defines the sequential order of the file. 42. What are called index-sequential files? The files that are ordered sequentially with a primary index on the search key are called index-sequential files. 43. What are the two types of indices? .Dense index .Sparse index 44. What are called multilevel indices? Indices with two or more levels are called multilevel indices. 45. What are called secondary indices? Indices whose search key specifies an order different from sequential order of the file are called secondary indices. The pointers in secondary index do not point directly to the file. Instead each points to a bucket that contains pointers to the file. 46. What are the disadvantages of index sequential files? The main disadvantage of the index sequential file organization is that performance degrades as the file grows. This degradation is remedied by reorganization of the file. 47. What is a B+-Tree index? A B+-Tree index takes the form of a balanced tree in which every path from the root of the root of the root of the tree to a leaf of the tree is of the same length. P1 K1 P2 K2 . Pn-1 Kn-1 Pn A node contains up to n-1 search key values and n pointers. 48. What is B-Tree? 20
A B-tree eliminates the redundant storage of search-key values .It allows search key values to appear only once. 49. What is hashing? Hashing allows us to find the address of a data item directly by computing a hash function on the search key value of the desired record. 50. How do you create index in SQL? We create index by he create index command. Create index<index name>on <relation name> (<attribute list>) 51. Distinguish between static hashing and dynamic hashing? Static hashing Static hashing uses a hash function in which the set of bucket adders is fixed. Such hash functions cannot easily accommodate databases that grow larger over time. Dynamic hashing Dynamic hashing allows us to modify the hash function dynamically. Dynamic hashing copes with changes in database size by splitting and coalescing buckets as the database grows and shrinks. 52. What is a hash index? A hash index organizes the search keys, with their associated pointers, into a hash file structure. 53. What can be done to reduce the occurrences of bucket overflows in a hash file organization? .To reduce bucket overflow the number of bucket is chosen to be (nr/fr)*(1+d). .We handle bucket overflow by using Overflow chaining(closed hashing) Open hashing 54. Differentiate open hashing and closed hashing (overflow chaining) Closed hashing (overflow chaining) If a record must be inserted in to a bucket b, and b is already full, the system provides an overflow bucket for b, and inserts the record in to the overflow bucket. If the overflow bucket is also full, the system provides another overflow bucket, and so on. All the overflow buckets of a given buckets are chained together in a linked list, overflow handling using linked list is known as closed hashing. Open hashing The set of buckets is fixed, and there are no overflow chains. Instead, if a bucket is full, the system inserts records in some other bucket in the initial set of buckets. 55. What is linear probing? Linear probing is a type of open hashing. If a bucket is full the system inserts records in to the next bucket that has space. This is known as linear probing. 56. What is called query processing? Query processing refers to the range of activities involved in extracting data from 21
a database. 57. What are the steps involved in query processing? The basic steps are: .parsing and translation .optimization .evaluation 58. What is called an evaluation primitive? A relational algebra operation annotated with instructions on how to evaluate is called an evaluation primitive. 59. What is called a query evaluation plan? A sequence of primitive operations that can be used to evaluate ba query is a query evaluation plan or a query execution plan. 60. What is called a query execution engine? The query execution engine takes a query evaluation plan, executes that plan, and returns the answers to the query. 61. How do you measure the cost of query evaluation? The cost of a query evaluation is measured in terms of a number of different resources including disk accesses, CPU time to execute a query, and in a distributed database system the cost of communication 62. List out the operations involved in query processing Selection operation Join operations. Sorting. Projection Set operations Aggregation PART B 1. Explain RAID levels in detail 2. Explain file organization in details. 3. Explain indexing and hashing 4. Explain B+ tree index in detail 5. Explain Query processing in detail. 6. Explain Ordered indices in detail. 7. Explain Static hashing. 8. Explain Dynamic hashing. 9. Explain organization of records in files. 10. Explain JOIN, SELECTION and SORTING 11.Explain Tertiary storage. 12.Explain the cost estimation 13.What is Query optimization ?What are different techniques used in it. 14.Discuss in detail the physical storage media 15.Explain the magnetic disks 16.DiscussDatabasetuning
22
CS2251 -DESIGN AND ANALYSIS OF ALGORITHMS UNIT I 1.What is an Algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate input in a finite amount of time 2.State the Euclids algorithm for finding GCD of two given numbers. ALGORITHM Euclid (m, n) // Computes gcd(m,n) by Euclids algorithm //Input : Two nonnegative, not-both-zero integers m and n //Output: Greatest common divisor of m and n while n =0 do r= m mod n m=n n=r return m. 3.What are Sequential Algorithms? The central assumption of the RAM model is that instructions are executed one after another, one operation at a time. Accordingly, algorithms designed to be executed on such machines are called Sequential algorithms. 4.What are Parallel Algorithms? The central assumption of the RAM model does not hold for some newer computers that can execute operations concurrently, i.e., in parallel algorithms that take advantage of this capability are called Parallel algorithms. 5.What is Exact and Approximation algorithm? The principal decision to choose solving the problem exactly is called exact algorithm. The principal decision to choose solving the problem approximately is called Approximation algorithm. 6.What is Algorithm Design Technique? An algorithm design technique is a general approach to solving problems algorithmically that is applicable to a variety of problems from different areas of computing. 7.Define Pseudo code. A Pseudo code is a mixture of a natural language and programming language like constructs. A pseudo code is usually more precise than a natural language, and its usage often yields more succinct algorithm descriptions. 8.Define Flowchart. A method of expressing an algorithm by a collection of connected geometric shapes containing descriptions of the algorithms steps. 9.Explain Algorithms Correctness To prove that the algorithm yields a required result for every legitimate input in a finite amount of time. Example: Correctness of Euclids algorithm for computing the greatest common divisor stems from correctness of the equality gcd (m, n) = gcd (n, m mod n). 10.What is Efficiency of algorithm? Efficiency of an algorithm can be precisely defined and investigated with mathematical rigor. There are two kinds of algorithm efficiency 23
1) 2)
Time Efficiency Indicates how fast the algorithm runs Space Efficiency Indicates how much extra memory the algorithm needs.
11.What is generality of an algorithm? It is a desirable characteristic of an algorithm. Generality of the problem the algorithm solves is sometimes easier to design an algorithm for a problem posed in more general terms. 12.What is algorithms Optimality? Optimality is about the complexity of the problem that algorithm solves. What is the minimum amount of effort any algorithm will need to exert to solve the problem in question is called algorithms Optimality. 13.What do you mean by Sorting problem? The sorting problem asks us to rearrange the items of a given list in ascending order (or descending order) 14.What do you mean by earching problem? S The searching problem deals with finding a given value, called a search key, in a given set. 15.What do you mean by Worst case-Efficiency of an algorithm? The Worst case-Efficiency of an algorithm is its efficiency for the worst-case input of size n, which is an input (or inputs) of size n for which the algorithm runs the longest among all possible inputs of that size. Ex: if you want to sort a list of numbers in ascending order when the numbers are given in descending order. In this running time will be the longest. 16.What do you mean by Best case-Efficiency of an algorithm? TheBestcaseEfficiencyofanalgorithmisitsefficiencyfortheBestcaseinputofsizen,whichis aninput(orinputs)ofsizenforwhichthealgorithmrunsthefastestamongallpossibleinputsof thatsize.Ex:ifyouwanttosortalistofnumbersinascendingorderwhenthenumbersaregivenin ascendingorder.Inthisrunningtimewillbethesmallest. 17.Define the Average-case efficiency of an algorithm? The Average-case efficiency of an algorithm is its efficiency for the input of size n, for which the algorithm runs between the best case and the worst case among all possible inputs of that size. 18.What do you mean by Amortized efficiency? The Amortized efficiency applies not only a single run of an algorithm but rather to a sequence of operations performed on the same data structure. It turns out that in some situations a single operation can be expensive ,but the total time for an entire sequence of n such operations is always significantly better than the worst case efficiency of that single operation multiplied by n. This is known as Amortized efficiency. 19.How to measure the algorithms efficiency? It is logical to investigate the algorithms efficiency as a function of some parameter n indicating the algorithms input size.Example: It will be the size of the list for problems of sorting, searching, finding the lists smallest element, and most other problems dealing with lists. 20.What is called the basic operation of an algorithm? The most important operation of the algorithm is the operation contributing the most to the total running time is called basic operation of an algorithm.
24
21.How to measure an algorithms running time? Let Cop be the time of execution of an algorithms basic iteration on a particular computer and let C (n) be the number of times this operation needs to be executed for this algorithm. Then we can estimate the running time T(n) of a program implementing this algorithm on that computer by the formula T(n) Cop C(n) 22.Define order of growth. The efficiency analysis framework concentrates on the order of growth of an algorithms basic operation count as the principal indicator of the algorithms efficiency. To compare and rank such orders of growth we use three notations O (Big oh) notation (Big Omega) notation & (Big Theta) notation 23.Define Big oh notation May/June 2006, April/May 2008 A function t(n) is said to be in O(g(n)) denoted t(n) O (g(n)), if t(n) is bounded above by some constant multiple of g(n) for all large n, i.e., if there exist some positive constant c and some non negative integer n0 such that T (n) < c g (n) for n > n0 24.Prove that 100n+5 O (n2)? Clearly 100n+5 100n+n (for all n 5) = 101n 101n2 By choosing n0=5 and c=101 we find that 100n+5O (n2). 25.Define notation A function t(n) is said to be in (g(n)), denoted t(n) (g(n)), if t(n) is bounded below by some positive constant multiple of g(n) for all large n, i.e., if there exist some positive constant c and some non negative integer n0 such that T (n) < c g (n) for n > n0 26.Provethatn3 n 2) ( 3 2 Clearlyn n foralln0.i.e.,wecanselectc=1andn0=0. 27.Define - notation A function t(n) is said to be in (g(n)), denoted t(n) (g(n)), if t(n) is bounded both above and below by some positive constant multiples of g(n) for all large n, i.e., if there exist some positive constant c1 and c2 and some non negative integer n0 such that c2 g (n) < t (n) < c1 g(n) for n > n0 28.Prove that( )n(n-1) n 2) ( 2 1/2n(n-1)=(1/2)n -1/2n 1/2 n2 for all n0.(we have proved upper inequality) now 1/2n(n1)=(1/2)n2-1/2n(1/2)n2-1/2n*1/2n(for all n2)=1/4 n2 hence we can select c2=1/4,c1=1/2 and n0=2. 29.What is the use of Asymptotic Notations? The notations O, and and are used to indicate and compare the asymptotic orders of growth of functions expressing algorithm efficiencies.
25
UNIT II 1) Explain divide and conquer algorithms Divide and conquer is probably the best known general algorithm design technique. It work according to the following general plan i)A problem's instance is divided into several smaller instances of the same problem, ideally of about the same size. ii) The smaller instances are solved iii) If necessary, the solutions obtained for the smaller instances are combined to get a solution to the original problem 2) Define Merge Sort Merge sort is a perfect example of a successful application of the divide and conquer technique. It sorts a given array A[0...n-l] by dividing it into two halves A[0...[n/2] - 1] and A[[n/2]....n-l], sorting each of them recursively, and then merging the two smaller sorted arrays into a single sorted one. 3) Define Binary Search Binary Search is remarkably efficient algorithm for searching in a sorted array. It works by comparing a search key K with the array's middle element A[m]. If they match, the algorithm stops; Otherwise, the same operation is repeated recursively for the first half of the array if K< A[m] and for the second half if K > A[m] A[0].............A[m-l] A[m] A[m+l]............. A[n-l] 4) What can we say about the average case efficiency of binary search? A sophisticated analysis shows that the average number of key comparisons made by binary search is only slightly smaller than that in the worst case Cavg(n) log2n 5) Define Binary Tree A binary tree T is defined as a finite set of nodes that is either empty or consists of s root and two disjoint binary trees TL, and T called, respectively the left and right subtree of the root.
R
6) How divide and conquer technique can be applied to binary trees? Since the binary tree definition itself divides a binary tree into two smaller structures of the same type, the left subtree and the right subtree, many problems about binary trees can be solved by applying the divide-conquer technique. 7) Explain Internal and External Nodes To draw the tree's extension by replacing the empty subtrees by special nodes.The extra nodes shown by little squares are called external. The original nodes shown by littile circles are called internal. 8) Define Preorder, inorder and postorder Traversal PREORDER -The root is visited before the left and right subtrees are visited (in that order) INORDER -The root is visited after visiting its left subtree but before visiting the right Subtree POSTORDER - The root is visited after visiting the left and right subtrees(in that order) 9) Define the Internal Path Length The Internal Path Length I of an extended binary tree is defined as the sum of the lengths of the paths - taken over all internal nodes- from the root to each internal node. 10) Define the External Path Length The External Path Length E of an extended binary tree is defined as the sum of the lengths of the paths - taken over all external nodes- from the root to each external node. 26
11) Explain about greedy technique The greedy technique suggests constructing a solution to an optimization problem through a sequence of steps, each expanding a partially constructed solution obtained so far, until a complete solution to the problem is reached. On each step, the choice made must be feasible, locally optimal and irrevocable. 12) Define Spanning Tree A Spanning Tree of a connected graph is its connected acyclic subgraph(i.e., a tree) that contains all the vertices of the graph. 13) Define Minimum Spanning Tree A minimum spanning tree of a weighted connected graph is its spanning tree of the smallest weight ,where the weight of a tree is defined as the sum of the weights on all its edges. 14) Define min-heap A min-heap is a complete binary tree in which every element is less than or equal to its children. All the principal properties of heaps remain valid for min-heaps, with some obvious modifications. 15) Define Kruskal's Algorithm Kruskal's algorithm looks at a minimum spanning tree for a weighted connected graph G =(V,E) as an acyclic subgraph with | V| - 1 edges for which the sum of the edge weights is the smallest. 16) Define Prim's Algorithm Prim's algorithm is a greedy algorithm for constructing a minimum spanning tree of a weighted connected graph.It works by attaching to a previously constructed subtree a vertex to the vertices already in the tree. 17) Explain Dijkstra's Algorithm Dijkstra's algorithm solves the single - source shortest - path problem of finding shortest paths from a given vertex (the source) to all the other vertices of a weighted graph or digraph. It works as prim's algorithm but compares path lengths rather than edge lengths. Dijkstra's algorithm always yields a correct solution for a graph with nonnegative weights. UNIT-III 1)Define Dynamic Programming Dynamic programming is a technique for solving problems with overlapping problems. Typically, these subproblems arise from a recurrence relating a solution to a given problem with solutions to its smaller subproblems of the same type. Rather than solving overlapping subproblems again and again, dynamic programming suggests solving each of the smaller sub problems only once and recording the results in a table from which we can then obtain a solution to the original problem. 2) Define Binomial Coefficient n The Binomial Coefficient, denoted C(n,k) or k is the number of Combinations(subsets) of k elements from an n-element set(0<k<n). The name "binomial coefficients" comes from the participation of these numbers in the so called binomial formula (a+b)n =(n,0)an+..........+C(n,i)an-ibi+.......+C(n,n)bn 3) Define Transitive closure 27
The transitive closure of a directed graph with n vertices can be defined as the n by n Boolean matrix T = {ti,}, in which the element in the ith row (1<i<n) and the jth column (l<j<n) is 1 if there exists a non trivial directed path from the ith vertex to jth vertex ; otherwise , tij is 0. 4) Explain Warshalls algorithm Warshall's algorithm constructs the transitive closure of a given digraph with n vertices through a series of n by n Boolean matrices R(0), , R(k-l)R(k),.., R(n) Each of these matrices provides certain information about directed paths in the digraph. 5) Explain All-pair shortest-paths problem Given a weighted connected graph (undirected or directed), the all pairs shortest paths problem asks to find the distances(the lengths of the shortest path) from each vertex to all other vertices. 6) Explain Floyd's algorithm It is convenient to record the lengths of shortest paths in an n by n matrix D called the distance matrix: the element dij in the ith row and the jth column of this matrix indicates the length of the shortest path from the ith vertex to the jth vertex . We can generate the distance matrix with an algorithm that is very similar to warshall's algorithm. It is called Floyd's algorithm. 7) What does Floyds algorithm do? It is used to find the distances (the lengths of the shortest paths) from each vertex to all other vertices of a weighted connected graph. 8) Explain principle of Optimality It says that an optimal solution to any instance of an optimization problem is composed of optimal solutions to its subinstances. 9) Explain Optimal Binary Search Trees One of the principal application of Binary Search Tree is to implement the operation of searching. If probabilities of searching for elements of a set are known, it is natural to pose a question about an optimal binary search tree for which the average number of comparisons in a search is the smallest possible. 10) Explain Knapsack problem Given n items of known weights w1,w2...........wn and values v1,v2............vn and a knapsack of capacity W, find the most valuable subset of the items that fit into the knapsack.(Assuming all the weights and the knapsack's capacity are positive integers the item values do not have to be integers.) 11) Explain the Memory Function technique The Memory Function technique seeks to combine strengths of the top down and bottom-up approaches to solving problems with overlapping subproblems. It does this by solving, in the topdown fashion but only once, just necessary sub problems of a given problem and recording their solutions in a table. 12) Explain Traveling salesman problem? A salesman has to travel n cities starting from any one of the cities and visit the remaining cities exactly once and come back to the city where he started his journey in such a manner that either the distance is minimum or cost is minimum. This is known as traveling salesman problem.
UNIT-IV 28
l) Explain Backtracking The principal idea is to construct solutions one component at a time and evaluate such partially constructed candidates as follows. > If a partially constructed solution can be developed further without violating the problem's constraints, it is done by taking the first remaininig legitimate option for the next component. > If there is no legitimate option for the next component, no alternatives for any remaining component need to be considered. In this case, the algorithm backtracks to replace the last component of the partially constructed solution with its next option 2) Explain State Space Tree If it is convenient to implement backtracking by constructing a tree of choices being made, the tree is called a state space tree. Its root represents an initial state before the search for a solution begins. 3) Explain promising and nonpromising node A node in a state space tree is said to be promising if it corresponds to a partially constructed solution that may still lead to a complete solution;otherwise it is called nonpromising 4) Explain n-Queens problem The problem is to place n queens on an n by n chessboard so that no two queens attack each other by being in the same row or same column or on the same diagonal. 5) Explain Subset-Sum Problem We consider the subset-sum problem: Find a subset of a given set S={S1,S2,..........Sn} of n positive integers whose sum is equal to a given positive integer d. 6) Explain Branch and Bound Technique Compared to backtracking, branch and bound requires The idea to be strengthened further if we deal with an optimization problem, one that seeks to minimize or maximize an objective function, usually subject to some constraints. 7) Define Feasible Solution A feasible solution is a point in the problem's search space that satisfies all the problem's constraints. Ex: A Hamiltonian Circuit in the traveling salesman problem. A subset of items whose total weight does not exceed the knapsack's Capacity 8) Define Optimal solution Is a feasible solution with the best value of the objective function Eg: The shortest Hamiltonian Circuit The most valuable subset of items that fit the knapsack 9) Mention two reasons to terminate a search path at the current node in a state-space tree of a branch and bound algorithm. The value of the node's bound is not better than the value of the best solution seen so far. The node represents no feasible solutions because the constraints of the problem are already violated. 10) Explain Graph coloring problem. The graph coloring problem asks us to assign the smallest number of colors to vertices of a graph so that no two adjacent vertices are the same color. 11) Explain Knapsack Problem 29
Find the most valuable subset of n items of given positive integer weights and values that fit into a knapsack of a given positive integer capacity. UNIT-V 1) Define tractable and intractable problems Problems that can be solved in polynomial time are called tractable problems, problems that cannot be solved in polynomial time are called intractable problems. 2) Explain the theory of computational complexity A problem's intractability remains the same for all principal models of computations and all reasonable input encoding schemes for the problem under consideration 3)Explain class P problems Class P is a class of decision problems that can be solved in polynomial time by(deterministic) algorithms. This class of problems is called polynomial. 4)Explain undecidable problems If the decision problem cannot be solved in polynomial time, and if the decision problems cannot be solved at all by any algorithm. Such problems are called Undecidable. 5) Explain the halting problem Given a computer program and an input to it,determine whether the program will halt on that input or continue working indefinitely on it. 6) Explain class NP problems Class NP is the class of decision problems that can be solved by nondeterministic polynomial algorithms.Most decision problems are in NP. First of all, this class includes all the problems in P. This class of problems is called Nondeterministic polynomial. 7)Explain NP-complete problems A decision problem d is said to be NP-complete if 1) it belongs to class NP 2) every problem in NP is polynomially reducible to D. 8)When a decision problem is said to be polynomially reducible A decision problem Dl is said to be polynomially reducible to a decision problem D2 if there exists a function t that transforms instances of Dl to instances ofD2 such that i) t maps all yes instances of d1 to yes instances odf d2 and all no instances of dl to no instances ofd2 ii) t is computable by a polynomial time algorithm 9) Define a Heuristic A heuristic is a common-sense rule drawn from experience rather than from a mathematically proved assertion. Ex: Going to the nearest unvisited city in the traveling salesman problem is a good illustration for Heuristic 10) Explain NP-Hard problems The notion of an NP-hard problem can be defined more formally by extending the notion of polynomial reducability to problems that are not necessary in class NP including optimization problems. 11)Define Traversals. 30
When the search necessarilyinvolves the examination of every vertex in the object being searched it is called a traversal. 12)List out the techniques for traversals in graph. Breadth first search Depth first search 13)What is articulation point. A vertex v in a connected graph G is an articulation point if and only if the deletion of vertex v together with all edged incident to v disconnects the graph in to two or more nonempty components. PART-B I-UNIT 1. (a) Describe the steps in analyzing & coding an algorithm. (10) (b) Explain some of the problem types used in the design of algorithm. (6) 2.(a) Discuss the fundamentals of analysis framework . (10) (b) Explain the various asymptotic notations used in algorithm design. (6) 3. (a) Explain the general framework for analyzing the efficiency of algorithm. (8) (b) Explain the various Asymptotic efficiencies of an algorithm. (8) 4. (a) Explain the basic efficiency classes. (10) (b) Explain briefly the concept of algorithmic strategies. (6) 5. Describe briefly the notions of complexity of an algorithm. (16) 6. (a) What is Pseudo-code?Explain with an example. (8) (b) Find the complexity C(n) of the algorithm for the worst case,best case and average case.(Evaluate average case complexity for n=3,Where n is the number of inputs) (8) 7. Set up & solve a recurrence relation for the number of key comparisons made by above pseudo code. (4) II-UNIT 1) Write a pseudo code for divide & conquer algorithm for merging two sorted arrays in to a single sorted one.Explain with example. (12) 2) Construct a minimum spanning tree using Kruskals algorithm with your own example. (10) 3) Explain about Knapsack Problem with example 4) Explain Dijikstra algorithm (8) 5) Define Spanning tree.Discuss design steps in Prims algorithm to construct minimum spanning tree with an example. (16) 6)Explain Kruskals algorithm. (8) 7) Explain about binary search with example.
III-UNIT 31
1) Solve the all pair shortest path problem for the diagraph with the weighted matrix given below:ab c d a03 b20 c701 d 6 0 (16) 2) Explain Warshalls & Floyds Algorithm. (16) 3) Explain about Multistage graphs with example. 4) Define optimal binary search trees with example. 5) Explain 0/1 knapsack problem with example. 6) Discuss the solution for Travelling salesman problem using branch & bound technique. (16) IV-UNIT 1. Explain the 8-Queens problem & discuss the possible solutions. (16) 2. Solve the following instance of the knapsack problem by the branch & bound algorithm. (16) 3. Apply backtracking technique to solve the following instance of subset sum problem : S={1,3,4,5} and d=11 (16) 5. Explain subset sum problem & discuss the possible solution strategies using backtracking.(16) 6. Explain Graph coloring with example. 7. Explain about Knapsack Problem using back tracking with example. 8. Explain about Hamiltonian problem with algorithm. V-UNIT 1. Give a suitable example & explain the Breadth first search & Depth first search. (16) 2. Explain about biconnected components with example. 3. Briefly explain NP-Hard and NP-Completeness with examples. 4. Explain about 0/1 Knapsack Problem using branch and bound with example.
32