You are on page 1of 23

K.S.

R COLLEGE OF ENGINEERING DEPARTMENT INFORMATION TECHNOLOGY SEMESTER III IT 2205 Data structures And Algorithms Lab

Unit I

Linear Structures
Two Marks

1. Define Data structure. Data structure is a way of organizing data that considers not only the items stored but also the relation between each other. 2. Define Dynamic Data structure. It becomes possible to allocate old storage when it is needed and to discard old storage when it is needed during the program of execution. 3. Define Static Data Structure. It becomes to fixed amount of storage must be pre allocated, remain through correct the execution of the program. 4. List the operation performed by the data structure. Operating to create and destroy a data structure Insert element into the data structure Delete elements from to data structure Access elements within a data structure. 5. Define list. A list is an ordered set containing of a variable with number of elements to which insertion and deletion can be made. 6. Define an array? An array is a group of logically related data items of the same data type addressed by a common name and all items are stored in contiguous memory. 7. Difference between array and list. An array is an ordered set which consists of a fixed number of objects. No deletion or insertion operations are performed on array. A list is an ordered set, consisting of a variable number of elements to which insertion and deletion can be made. 8. Write down the uses of array? 1) The array is a powerful tool that is widely used in computing. 2) Arrays provide us with a very simple efficient way of referring to and perform Computations on collections of data that share some common attribute. 3) Arrays can be used to build and simulate finite state automata.

9. What do you mean by ASCII? One of the most widely used coding systems is called the American standard Code for information interchange or ASCII. It is fixed 8 bit cone used for representing characters. 10. What do you mean by debugging? Debugging is defined as the process of carrying out a number of tests to ensure that the program in behaving correctly according to its specification. It is also used for detecting logical errors. 11. Write down the qualities of a good algorithm? (i) They are simple but powerful and general solutions (ii) They can be easily understood by others (iii) They can be easily modified if necessary (iv) They are correct for clearly defined situation (v) The y are able to understood on a number of levels. 12. What do you mean by program verification? Program verification refers to the application of Mathematical proof application of Mathematical proof techniques to establish that the results obtain by the execution of a program with arbitrary inputs are in accord with formally defined output specification. 13. Define algorithm? An algorithm consist of a set of explicit and unambiguous finite steep which when carried out for a given set of initial conditions, produce the corresponding output and terminate in a finite time. 14. Define Storage structure. The Representation of a particular data structure in the memory of a computer is called a storage structure. 15. Define file structure. A storage structure representation in auxiliary memory is often called a file structure. 16. What is a flip flop? The state of information associated with a memory unit is stored in a piece of sequential circuitry called flip flop. It is a simple two state device. 17. Define data, atom and bit. Data is set of elementary items or atoms. An atom usually consists of single elements such as integers, bits, characters or a set of such items. A bit is a measure of information. 18. What are the two methods for using the data structures? i) Computed address method ii) Link addressing method.

19. Write any one example in array of structures? 1 Month sales(12) 2 sales person 3 Name 3 Region 2 sales details 3 Quota 3 Sales 20. What are the types of recursion? i) Direct recursion (Primitive recursive fn. Or Recursively defined fn.) ii) Indirect recursion (Non primitive or recursive or recursive use of a procedure) 21. What are the steps available internative processes? i) Initialization ii) Decision iii) Computation iv) Update 22. Define Stack A Stack is an ordered list in which all insertions and deletion are made at one end, called the top. In a stack S = (a1,an), a1 is the bottom most element and element ai is on top of element ai-1. Stack is also referred as Last In First Out (LIFO) list. 23. What are the various Operations performed on the Stack? The various operations that are performed on the stack are i) CREATE(S) Creates S as an empty stack ii) ADD (i, s) inserts the element I onto the stack s and returns the new stack. iii) DELETE(S) remove the top element of stack s and returns the new stack. iv) TOP(S) returns the top element of stack s. v) ISEMTS(S) returns true if s is empty else false. 24. How do you test for an empty stack? The condition for testing an empty stack is top 0. 25. Name two applications of stack? 1) Stake is used to explain the processing of subroutine calls and their returns. 2) Recursive procedures and evaluation of expressions can be implemented using stack. 26. Define a suffix expression. The notation used to write the operator at the end of the operands is called suffix notation. Suffix _ operand operand operator

27. What do you meant by fully parenthesized expression? Give eg. A pair of parentheses has the same parenthetical level as that of the operator to which it corresponds. Such an expression is called fully parenthesized expression. Ex: (a+((b *c) + (d * e)) 28. Write the steps in the general algorithm for recursive procedure? i) Prologue- save the parameters, local variables and return address ii) Body If the base criterion has been reached then perform the final computation and go to step3, otherwise perform the partial computation and go to step1. iii) Epilogue Restore the most recently saved parameters local variables and return address. Go to return address. 29. Write the general algorithm for solving the Tower of Hanoi problem? a. Only one disc may be moved at a time. b. A disc may be moved from any needle to any other c. At no time may a larger disc rest upon a smaller disc. 30. What does the meaning of AVAIL pointer? 1. Where the pointer variable AVAIL contains the address of the top node in the stack. 31.What is meant by an abstract data type? An ADT is a set of operation. Abstract data types are mathematical abstractions.Eg.Objects such as list, set and graph along their operations can be viewed as ADT's. 32. What are the operations of ADT? Union, Intersection, size, complement and find are the various operations of ADT. 33. What is meant by list ADT? List ADT is a sequential storage structure. General list of the form a1, a2, a3.., an and the size of the list is 'n'. Any element in the list at the position I is defined to be ai, ai+1 the successor of ai and ai-1 is the predecessor of ai. 34. What are the various operations done under list ADT? Print list Insert Make empty Remove Next Previous Find kth

35. What are the different ways to implement list? Simple array implementation of list Linked list implementation of list 36. What are the advantages in the array implementation of list? a) Print list operation can be carried out at the linear time b) Find Kth operation takes a constant time 37. What is a linked list? Linked list is a kind of series of data structures, which are not necessarily adjacent in memory. Each structure contains the element and a pointer to a record containing its successor. 38. What is a pointer? Pointer is a variable, which stores the address of the next element in the list. Pointer is basically a number. 39. What is a doubly linked list? In a simple linked list, there will be one pointer named as 'NEXT POINTER' to point the next element, where as in a doubly linked list, there will be two pointers one to point the next element and the other to point the previous element location. 40. Define double circularly linked list? In a doubly linked list, if the last node or pointer of the list, point to the first element of the list, then it is a circularly linked list. 41. What is the need for the header? Header of the linked list is the first element in the list and it stores the number of elements in the list. It points to the first data element of the list. 42. List three examples that uses linked list? Polynomial ADT Radix sort Multi lists 43. Give some examples for linear data structures? Stack Queue 44. What is a stack? Stack is a data structure in which both insertion and deletion occur at one end only. Stack is maintained with a single pointer to the top of the list of elements. The other name of stack is Last-in -First-out list. 45. Write postfix from of the expression A+B-C+D? A-B+C-D+

46. How do you test for an empty queue? To test for an empty queue, we have to check whether READ=HEAD where REAR is a pointer pointing to the last node in a queue and HEAD is a pointer that pointer to the dummy header. In the case of array implementation of queue, the condition to be checked for an empty queue is READ<FRONT. 47. What are the postfix and prefix forms of the expression? A+B*(C-D)/(P-R) Postfix form: ABCD-*PR-/+ Prefix form: +A/*B-CD-PR 48. Explain the usage of stack in recursive algorithm implementation? In recursive algorithms, stack data structures is used to store the return address when a recursive call is Encountered and also to store the values of all the parameters essential to the current state of the procedure. 49. Write down the operations that can be done with queue data structure? Queue is a first - in -first out list. The operations that can be done with queue are addition and deletion. 50. What is a circular queue? The queue, which wraps around upon reaching the end of the array is called as circular queue. 51. Define Queues. A Queue is an ordered list in which all insertions take place at one end called the rear, while all deletions take place at the other end called the front. Queue is also referred as First In First Out (FIFO) list. 52. What are the various operations performed on the Queue? CREATEQ(Q) Create Q as an empty Queue ADDQ (I, Q) adds the element I to the rear of a queue and returns the new queue. DELETEQ(Q) remove the front element from the queue Q and returns the new queue FRONT(Q) returns the front element of Q 53. How do you test for an empty Queue? The condition for testing an empty Queue is front= rear. 54. Define Dqueue. Double entered Queue. It is a linear list in which insertions and deletion are made or from either end of the structure. 55. Define priority queue. A Queue in which we are able to insert items or remove items from any position based on some priority is after referred to as a priority Queue

56. Short note on priority queue? Sometimes the user programs that are waiting to be processed from a waiting queue. This queue may not operate on a strictly first out basis, but on some complex priority scheme based on such factors as what compiler is being used the execution time required the number of print lines desired etc. the resulting queue is sometimes called a priority queue.

Part B
1. Explain the linked list implementation of list ADT in Detail? Definition for linked list Figure for linked list Next pointer Header or dummy node Various operations Explanation Example figure Coding 2. Explain the cursor implementation of linked list? Definition for linked list Figure for linked list Next pointer Header or dummy node Various operations Explanation Example figure Coding 3. Explain the various applications of linked list? Polynomical ADT Operations Coding Figure Radix Sort Explanation Example Multilist Explanation Example figure 4. Explain the linked list implementation of stack ADT in detail? Definition for stack Stack model Figure Pointer-Top Operations

Coding Example figure 5. Explain the array implementation of queue ADT in detail? Definition for stack Stack model Figure Pointer-FRONT, REAR Operations Coding Example figure

Unit II Tree Structures Two Marks


1. Define non-linear data structure Data structure which is capable of expressing more complex relationship than that of physical adjacency is called non-linear data structure. 2. Define tree? A tree is a data structure, which represents hierarchical relationship between individual data items. 3. Define leaf? In a directed tree any node which has out degree o is called a terminal node or a leaf. 4. What is meant by directed tree? Directed tree is an acyclic diagraph which has one node called its root with indegree o while all other nodes have indegree I. 5. What is a ordered tree? In a directed tree if the ordering of the nodes at each level is prescribed then such a tree is called ordered tree. 6. What are the applications of binary tree? Binary tree is used in data processing. a. File index schemes b. Hierarchical database management system 7. What is meant by traversing? Traversing a tree means processing it in such a way, that each node is visited only once. 8. What are the different types of traversing? The different types of traversing are a. Pre-order traversal-yields prefix form of expression. b. In-order traversal-yields infix form of expression. c. Post-order traversal-yields postfix form of expression. 9. What are the two methods of binary tree implementation? Two methods to implement a binary tree are, a. Linear representation. b. Linked representation 10. Define pre-order traversal? Pre-order traversal entails the following steps; a. Process the root node b. Process the left subtree c. Process the right subtree

11. Define post-order traversal? Post order traversal entails the following steps; a. Process the left subtree b. Process the right subtree c. Process the root node 12. Define in -order traversal? In-order traversal entails the following steps; a. Process the left subtree b. Process the root node c. Process the right subtree 13. What is a balance factor in AVL trees? Balance factor of a node is defined to be the difference between the height of the node's left subtree and the height of the node's right subtree. 14. What is meant by pivot node? The node to be inserted travel down the appropriate branch track along the way of the deepest level node on the branch that has a balance factor of +1 or -1 is called pivot node. 15. What is the length of the path in a tree? The length of the path is the number of edges on the path. In a tree there is exactly one path form the root to each node. 16. Define expression trees? The leaves of an expression tree are operands such as constants or variable names and the other nodes contain operators. Write the definition of simple path and elementary path? A path in a digraph in which the edges are distinct is called a simple path. A path in which all the nodes through which it traverses are distinct is called an elementary path. 17. Short note on spanning trees. A spanning tree of a graph is an undirected consisting of only those edges necessary to connect all the nodes in the original graph. A spanning tree has the properties that for any pair of nodes there exists only one path between them and the insertion of any edge to a spanning tree from a unique cycle. 18. Define graph? A graph G consists of a nonempty set V called the set nodes of the graph a set E which is the set of edges of the graph and a mapping from the set of edges E to a set of pairs of elements of V.

19. Define converse preceding definitions. We obtain three new traversal orders which are called the converse preorder, converse in order and converse post order respectively. 20. Define converse in order, converse preorder and converse post order? The words left and right are interchanged in the preceding definitions. We obtain three new traversal orders which are called the converse preorder, converse in order and converse post order respectively. 21. Write the recursive preorder algorithm? Procedure Preorder (T) 1. Process the root node 2. Process the left sub tree 3. Process the right sub tree 4. Finished 22. Define adjacency matrix? An n x n matrix A whose elements aij are given by Aij = 1 if (vi, vj) E 0 otherwise Is called the adjacency matrix of the graph G. 23. Define hit matrix or Boolean matrix? Any element of the adjacency matrix is either 0 or 1. Any matrix whose elements are either 0 or 1 is called a bit matrix or a Boolean matrix. 24. Define reach ability matrix or path matrix? Let G = (V, E) be a simple digraph which contains n nodes that are assumed to be ordered. An n x n matrix P whose elements are given by Pij = 1 if there exists a path from vi to vj 0 otherwise Is called the path matrix or reach ability matrix of the graph G. 25. Write WARSHALL algorithm 1. Initialize 2. Perform a pass 3. Process columns 4. Finished 26. Write the space and time requirement for the WARSHALL algorithm? The timing requirement of the algorithm is o (u3) the space requirement is o ( n2) 27. What are the properties available in list structures? 1. Order 2. Depth 3. Length 28. What is meant by order? A transitive relation defined on the element of the list and specified by the sequence in which the elements appear within the list.

29. What is meant by depth? The depth of a list is the maximum level attributed to any element with in the list or with in any sub list in the list. 30. What is meant by length? The number of elements at level 1 list. for example, the length of list (a, (b, c), d) is 3. 31. What is the use of BFS? BFS can be used to find the shortest distance between some starting node and the remaining nodes of the graph. The shortest distance is the minimum number of edges traversed in order to travel from the start node the specific node being examined. 32. Write DFS algorithm Procedure DFS (index, count) 1. Update the depth first search number, set and mark current node 2. Set up loop to examine each neighbor of current node 3. If node has been marked label it and make recursive call 4. Return to point of all 33. Write BFS algorithm 1. Initialize the first nodes dist number and place in queue 2. Repeat until all nodes have been examined 3. Remove current node to be examined from queue 4. Find all unlabeled nodes adjacent to current node 5. If this is an unvested node label it and add it to the queue 6. Finished. 34. Define biconnected graph? A graph is called biconnected if there is no single node whose removal causes the graph to break into two or more pieces. A node whose removal causes the graph to become disconnected is called a cut vertex. 35. Write the minimal spanning tree algorithm 1. Check off nodes in the first edge 2. Set loop and repeat until all edges have been examined 3. Finished. 36. Define PERT graph? A PERT graph is a finite digraph with no parallel edges or cycles, in which there is exactly one source and one link. 37. Write the time complexly of BFS algorithm The time analysis for the BFS algorithm is O(n + e) Where is the number of edges and n is the number vertices.

38. Explain fixed block storage allocation Function GET BLOCK (Head) 1. Overflow 2. Allocate block 3. Finished. 39. Define external fragmentation? Decomposing the total available storage into a larger number of relatively small b blocks is called external fragmentation. 40. Define internal fragmentation? Partitioning the total unused storage into available blocks and allocating these blocks with some portion of the blocks remaining unused but not available is called internal fragmentation. 41. Write allocate first algorithm? Function Allocate first (Avail, n min) 1. Initialize 2. Find block large enough for request 3. No suitable block 42. Define tracks. The cylindrical surface of the drum is divided into a number of parallel bans called tracks. 43. Define access time? The access time A (i) associated with a particular I/O operation I can be expressed as the sum of the latency time and the latency time and the seek time for i. That is A (i) = L (i) + S (i) 44. Write allocate buddy algorithm Function Allocate Buddy (N) 1. Determine size code 2. Find first available block 3. Split as required until correct size is reached 4. Allocate block P of size Fi. 45. Write Free Buddy algorithm Function Free buddy (P) 1. Perform all possible merges 2. Merge block 3. We get here if only if P is the maximal block

PART-B
1. Explain the different tree traversals with an application? In order Explanation with an example Figure Preorder Explanation with an example Figure Postorder Explanation with an example Figure 2. Define binary search tree? Explain the various operations with an example? Definition Figure for binary search tree Operations Codings Explanation Example 3. Define AVL trees? Explain the LL, RR, RL, LR case with an example? Definition LL, RR, RL, LR case Figure Example Explanation 4. Define priority queue? Explain the basic heap operation with an example? Definition Basic operation Insert Delmin Delmax Coding Explanation Example 5. Explain any two techniques to overcome hash collision? Separate chaining Example Explanation Coding Open addressing Linear probing Quadratic probing

Unit III

Hashing and Sets


Two Marks

1. Define Hashing. The ideal hash table data structure is merely an array of some fixed size, containing the keys. Each key is mapped into some number in the range 0 to TableSize - 1 and placed in the appropriate cell. (Hash function). A hash function should: Be simple to compute Ensure that any two distinct keys get different cells. 2. What is meant by Rehashing? If the table gets too full, the running time for the operations will start taking too long and inserts might fail for open addressing hashing with quadratic resolution. Rehashing (1) Build another table that is about twice as big (with an associated new hash function). (2) Scan down the entire original hash table. (3) Compute the new hash value for each (nondeleted) element. (4) Insert the element in the new table.

3. Define Binary Heap. It is common for priority queue implementations. Two properties: A structure property A heap order property

4. What is the need for hashing? Hashing is used to perform insertions, deletions and find in constant average time. 5. Define hash function? Hash function takes an identifier and computes the address of that identifier in the hash table using some function. 6. List out the different types of hashing functions? The different types of hashing functions are, a. The division method b. The mind square method c. The folding method d. Multiplicative hashing e. Digit analysis

7. What are the problems in hashing? a. Collision b. Overflow 8. What are the problems in hashing? When two keys compute in to the same location or address in the hash table through any of the hashing function then it is termed collision. 9. What is Heap Order Property? For every node X, the key in the parent of X is smaller than (or equal to) the key in X, with the exception of the root (which has no parent). The minimum element can always be found at the root. (FindMin in constant time)

10. What are the Basic Heap Operations? To insert an element X into the heap Percolate up DeleteMin Algorithm Percolate down

11. What is d-Heaps? Exactly like a binary heap except that all nodes have d children. A d-heap is much shallower than a binary heap, improving the running time of Inserts to O(logd N). For large d, the DeleteMin operation is more expensive, because even though the tree is shallower, the minimum of d children must be found, which takes d - 1 comparison. The time for this operation raised to O(d logd N). Multiplications and divisions to find children and parents are now by d, which, unless d is a power of 2, seriously increases the running time, because no longer implement multiplication and division by a bit shift. Two most weaknesses of heap implementation: Inability to Finds Merging is a hard operation.

12. Double Hashing One popular choice is F(i) = i * hash2(X) The hash2 function must never evaluate to zero. The function below will work well: hash2(X) = R - (X mod R) where R is a prime smaller than TableSize.

13. Define Open Addressing. If a collision occurs, alternative cells are tried until an empty cell is found. Cells h0(X), h1(X), h2(X), .... are tried in succession, where hi(X) = (Hash(X) + F(i)) mod TableSize, with F(0) = 0. The function, F, is the collision resolution strategy. All the data go inside the table, a bigger table is needed for open addressing hashing than for separate chaining hashing. Generally, the load factor should be below 0.5.

14. Define primary clustering. Any key that hashes into the cluster will require several attempts to resolve the collision, and then it will add to the cluster. (even if the table is relatively empty). 15. What is Random collision resolution? Assumptions: a very large table and each probe is independent of the previous probes. The expected number of probes in an unsuccessful search is 1/(1 - ). Since changes from 0 to its current value, earlier insertions are cheaper and accessing it should be easier than accessing a recently inserted element. 16. Define secondary clustering? Elements that hash to the same position will probe the same alternative cells. Double hashing eliminates this (at the cost of extra multiplications and divisions)

Unit IV Graphs Two Marks


1. Define Graph? A graph G consist of a nonempty set V which is a set of nodes of the graph, a set E which is the set of edges of the graph, and a mapping from the set for edge E to a set of pairs of elements of V. It can also be represented as G= (V, E). 2. Define adjacent nodes? Any two nodes which are connected by an edge in a graph are called adjacent nodes. For example, if and edge x E is associated with a pair of nodes (u, v) where u, v V, then we say that the edge connects the nodes u and v. 3. What is a directed graph? A graph in which every edge is directed is called a directed graph. 4. What is a undirected graph? A graph in which every edge is undirected is called a directed graph. 5. What is a loop? An edge of a graph which connects to itself is called a loop or sling. 6. What is a simple graph? A simple graph is a graph, which has not more than one edge between a pair of nodes than such a graph is called a simple graph. 7. What is a weighted graph? A graph in which weights are assigned to every edge is called a weighted graph. 8. Define out degree of a graph? In a directed graph, for any node v, the number of edges which have v as their initial node is called the out degree of the node v. 9. Define indegree of a graph? In a directed graph, for any node v, the number of edges which have v as their terminal node is called the indegree of the node v.

10. Define path in a graph? The path in a graph is the route taken to reach terminal node from a starting node. 11. What is a simple path? A path in a diagram in which the edges are distinct is called a simple path. It is also called as edge simple. 12. What is a cycle or a circuit? A path which originates and ends in the same node is called a cycle or circuit. 13. What is an acyclic graph? A simple diagram which does not have any cycles is called an acyclic graph. 14. What is meant by strongly connected in a graph? An undirected graph is connected, if there is a path from every vertex to every other vertex. A directed graph with this property is called strongly connected. 15. When is a graph said to be weakly connected? When a directed graph is not strongly connected but the underlying graph is connected, then the graph is said to be weakly connected. 16. Name the different ways of representing a graph? a. Adjacency matrix b. Adjacency list 17. What is an undirected acyclic graph? When every edge in an acyclic graph is undirected, it is called an undirected acyclic graph. It is also called as undirected forest. 18. What are the two traversal strategies used in traversing a graph? a. Breadth first search b. Depth first search 19. What is a minimum spanning tree? A minimum spanning tree of an undirected graph G is a tree formed from graph edges that connects all the vertices of G at the lowest total cost. 20. What is NP? NP is the class of decision problems for which a given proposed solution for a given input can be checked quickly to see if it is really a solution.

PART - B 1. Explain the various representation of graph with example in detail? Adjacency matrix Figure Explanation Table Adjacency list Figure Explanation Table 2. Define topological sort? Explain with an example? Definition Explanation Example Table Coding 3. Explain Dijkstra's algorithm with an example? Explanation Example Graph Table Coding 4. Explain Prim's algorithm with an example? Explanation Example Graph Table Coding 5. Explain Krushal's algorithm with an example? Explanation Example Graph Table Coding

Unit V

Algorithm design and analysis


Two Marks

2. What is meant by problem solving? Problem solving is a creative process, which needs systemization and mechanization. 3. Give few examples for data structures? Stacks, Queue, Linked list, Trees, graphs 4. What is problem definition phase? The first step in solving a problem is to understand problem clearly. Hence, the first phase is the problem definition phase. That is, to extract the task from the problem statement. If the problem is not understood, then the solution will not be correct and it may result in wastage of time and effort. 5. Define Algorithm? Algorithm is a solution to a problem independent of programming language. It consist of set of finite steps which, when carried out for a given set of inputs, produce the corresponding output and terminate in a finite time. 6. Define Program? Set of instructions to find the solution to a problem. It is expressed in a programming language in an explicit and unambiguous manner. 7. Mention how similarities among the problems are used in problem solving? This method is used to find out if a problem of this sort has been already solved and to adopt a similar method in solving the problem. The contribution of experience in the previous problem with helps and enhances the method of problem for the current problem. 8. What is working backward from the solution? When we have a solution to the problem then we have to work backward to find the starting condition. Even a guess can take us to the starting of the problem. This is very important to systematize the investigation to avoid duplication of our effort. 9. Mention some of the problem solving strategies? The most widely strategies are listed below Divide and conquer Binary doubling strategy Dynamic programming 10. What is divide and conquer method? The basic idea is to divide the problem into several sub problems beyond which cannot be further subdivided. Then solve the sub problems efficiently and join then together to get the solution for the main problem. 11. What are the features of an efficient algorithm? Free of ambiguity Efficient in execution time

Concise and compact Completeness Definiteness Finiteness 12. List down any four applications of data structures? Compiler design Operating System Database Management system Network analysis 13. What is binary doubling strategy? The reverse of binary doubling strategy, i.e. combining small problems in to one is known as binary doubling strategy. This strategy is used to avoid the generation of intermediate results. 14. Where is dynamic programming used? Dynamic programming is used when the problem is to be solved in a sequence of intermediate steps. It is particularly relevant for many optimization problems, i.e. frequently encountered in Operations research. 15. Define top-down design? Top-down design is a strategy that can be applied to find a solution to a problem from a vague outline to precisely define the algorithm and program implementation by stepwise refinement. 16. Mention the types of bugs that may arise in a program? The different types of bugs that can arise in a program are Syntactic error Semantic error Logical error 17. What is program testing? Program testing is process to ensure that a program solves the smallest possible problem, when all the variables have the same value, the biggest possible problem, unusual cases etc. 18. What is program verification? Program verification refers to the application of mathematical proof techniques, to verify that the results obtained by the execution of the program with arbitrary inputs are in accord with formally defined output Specifications. 19. How will you verify branches with segments? To handle the branches that appear in the program segments, it is necessary to set-up and proves verification conditions individually.

20. What is proof of termination? To prove that a program accomplishes its stated objective in a finite number of steps is called program termini nation. The proof of termination is obtained directly from the properties of the interactive constructs.

PART B
1. 2. 3. 4.

Explain the breadth first search algorithm? Explain the Depth first search algorithm? Explain about first-fit storage allocation with algorithm? Explain the matrix representation of graphs?

You might also like