Вы находитесь на странице: 1из 2

1)Define and state the importance of sub algorithm in computation and its relation ship with main algorithm?

A sub algorithm is an independent component of an algorithm and for this reason is defined separately from the main algorithm. The purpose of a sub algorithm is to perform some computation when required, under control of the main algorithm. This computation may be performed on zero or more parameters passed by the calling routine. 2) Give the difference of format between an algorithm and a sub algorithm? The format used is the same as for algorithms except that a return statement replaces an exit statement and a list of parameters follows the sub algorithms name. Although sub algorithms may invoke each other and that a sub algorithm may also invoke itself recursively 3) What is the general algorithm model for any recursive procedure? Prologue: -Saves the parameters, local variables and returns addresses. Body: -If the best criterion has been reached: then perform the final computation and go to step3, otherwise, perform the partial computation and go to step1. Restore the most recently saved parameters, local variables and return address. Go to this return addresses. 4) Explain the function of KWIC_Create? This algorithm analyses the input phrases and creates the three arrays needed in procedure KWIC_GEN. 5) Explain about the algorithm ORD_WORDS? This algorithm constructs the vectors TITLE, KEYWORD and T_INDEX. 6) Name any three skills which are very important in order to work with generating functions. The three most important skills which are used extensively while working with generating functions are 1)Manipulate summation expressions and their indices. 2)Solve algebraic equations and manipulate algebraic expressions, including partial function decompositions. 3)Identify sequences with their generating functions 7)The most basic tool used to express generating functions in closed form is the closed form expression for the geometric series, which is an expression of the form a+ar+ar2+-------+arn. It can either be terminated or extended indefinitely. What are the restrictions for this geometric series? If a and r represents numbers, r must not equal1 in the finite case.In the infinite case the absolute value of r must be less than 1.These restrictions dont come into play with Generating functions. 8) What is the general strategy for Markov Algorithm? The general strategy in a Markov Algorithm is to take as input a string x and, through a number of steps in the algorithm, transform x to an output string y. this transformation process is generally performed in computers for text editing or program compilation. 9) What are the two ways through which the Markov algorithm terminates? A Markov algorithm terminates in one of the two ways. 1) The last production is not applicable 2) A terminal production is applicable A terminal production is a statement of the form x map to y., where x and y represent the strings in V* and the symbol . Immediately follows the consequences. 10) Define string in an algorithmic notation and an example to support it? In the algorithmic notation, a string is expressed as any sequence of characters enclosed in single quote marks. E.g. a single quote contained within a string is represented by two single quotes. Therefore, the string It is John`s program. is represented as IT IS JOHNS PROGRAM.. 11) What are the arguments present in pattern matching algorithms? These are the following arguments which are present in pattern matching Algorithms. 1) Subject, 2) Pattern 3) Cursor 4) MATCH_STR 5) REPLACE_STR 6) REPLACE_FLAG 12) Explain the function SUB in algorithmic notation? In the algorithmic notation rather than using special marker symbols, generally people use the cursor position plus a substring length to isolate a substring. The name of the function is SUB. SUB returns a value the sub string of SUBJECT that is specified by the parameters i and j and an assumed value of j. 13) In Algorithmic context how would you define book keeping operations? Usually when a user wants to estimate time he isolates the specific function and brands it as active operation. The other operations in the algorithm, the assignments, the manipulations of the index and the accessing of a value in the vector, occur no more often than the addition of vector values. These operations are collectively called as book keeping operations. 14) Given a system of N equations whose coefficient matrix A is triangular and is stored in a vector R and the right hand side vector B, this algorithm obtains the solution vector X. Sum is a temporary variable. I am M are integer variables. How to follow the algorithm? The algorithm is easy to follow. X1 is first computed from the first equation and then substituted in the second to obtain X2 and so on. Another common application is one in which most of the elements of a large matrix are zeros. In such a case, only the non zero elements need to be stored along with their row and column sub scripts. 15) Define and describe an iterative process with general steps of flow chart? There are four parts in the iterative process they are Initialization: -The decision parameter is used to determine when to exit from the loop. Decision: -The decision parameter is used to determine whether to remain in the loop or not. Computation: - The required computation is performed in this part. Update: - The decision parameter is updated and a transfer to the next iteration results. 16) State recursion and its different types? Recursion is the name given to the technique of defining a set or a process in terms of itself. There are essentially two types of recursion. The first type concerns recursively defined function and the second type of recursion is the recursive use of a procedure. 17) How can an inductive definition be realized? An inductive definition of a set can be realized by using a given finite set of elements A and the following three clauses. 1) Basis Clause 2) Inductive clause 3) External clause 18) Explain about procedural body and computation boxes? The procedural body contains two computation boxes namely, the partial and final computational boxes. The partial computation box is combined with the procedure call box. The test box determines whether the argument value is that for which explicit definition of the process is given. 19) Explain the depth of recursion? This is another recursion procedure which is the number of times the procedure is called recursively in the process of enlarging a given argument or arguments. Usually this quantity is not obvious except in the case of extremely simple recursive functions, such as FACTORIAL (N), for which the depth is N. 20) State the problems which differentiate between recursive procedure and non-recursive procedure? A recursive procedure can be called from within or outside itself, and to ensure its proper functioning, it has to save in same order the return address so that it return to the proper location will result when the return to a calling statement is made. The procedure must also save the formal parameters, local variables etc. 1) What is the difference between Storage structure and file structure? The representation of a particular data structure in the memory of a computer is called a storage structure whereas a storage structure representation in auxiliary memory is often called a file structure. 2) Define data structure in terms of relation? The possible ways in which the data items or atoms are logically related define different data structures. 3) State procedure in accordance with function? A procedure is similar to a function but there is no value returned explicitly. A procedure is also invoked differently. Where there are parameters, a procedure returns its results through the parameters 4) Define an addressing function for a data structure? An addressing function for a data structure consisting of n elements is a function which maps the ith element of the data structure onto an integer between one and n. In the case of a vector, the addressing function f maps the ith element onto the integer (i).

5) How do you define a vector for a data structure? The simplest data structure that makes use of computed address to locate its elements is the one dimensional array and is called as a vector.

6) Define stack? An important sub class of lists permits the insertion or deletion of an element to occur only at one end. A linear list belonging to this sub class is called a stack.

7) Define and explain push and pop? The insertion operation is referred to as push and the deletion operation is referred to as pop. Since, insertion and deletion operations are performed at one end of the stack; the elements can only be removed in the opposite order from that in which they were added to the stack. This phenomenon is observed in conjunction with recursive functions.

8) Explain the three applications in which stacks are used? The first application majorly deals with the recursion, the second application is a classical and the last one is known as stack machines which chiefly deals with insertion and deletion from the stack.

9) State the theorem which is used to determine whether a given expression is valid or not. A polish suffix formula is well formed if and only if the rank of the formula is one and the rank of any proper head of a polish formula is greater than or equal to one.

10) What is a priority queue? Waiting queue may not operate on a strictly first in first out basis, but on some complex priority scheme based on such factors as what compiler is being used, the execution time required, number of print lines, etc. The resulting queue is called a priority queue.

11) What is linear hashing? In linear hashing, the table is gradually expanded by splitting the buckets in order until the table has doubled its size.

12) What is splitting? Splitting refers to the rehashing of a bucket b and its overflow in order to distribute the keys in them among b and one other primary location.

13) What is a one way chain or singly linked linear list? A list has been defined to consist of an ordered set of elements which may vary in number. A simple way to represent a linear list is to expand each node to contain a link or pointer to the next time.

14) Name two desirable properties of hashing functions. Some of the desirable properties of a hashing function are speed and the generation of addresses uniformly.

15) What is the distant relationship between a list structure and a digraph? In particular, a list is a directed graph with one source node corresponding to the entire list and with every node immediately connected to the source code.

16) Define Simulation? Simulation is the process of forming an abstract model from a real situation in order to understand the impact of modifications and the effect of introducing various strategies on the situation.

17) Define Index area and its subdivisions? Index area is created automatically by the data-management routines in the operating systems. A number of index levels may be involved in an indexed sequential file. The lowest of index is the track index, which is always written on the first track of the cylinders for the indexed sequential file. The track index contains two entries for each prime track of the cylinder a normal entry and an overflow entry.

18) Given N discs of decreasing size stacked on one needle and two empty needles, it is required to stack all the discs onto a second needle in decreasing order of size. The third needle may be used as temporary storage. The movement of the discs is restricted by the following rules (1) A disc may be moved from any needle to any other (2) Only one disc may be moved at a time (3) At no time may a larger disc rest upon smaller disc explain the solution? Ans) The solution to this problem is most clearly seen with the aid of induction, to move one disc, merely move it from needle A to needle C. To move two discs, move the first disc to needle B, move the second from needle A to needle C, then move the disc from needle B to needle C.

19) Define addressing and linear addressing functions? There are many data structures which can be represented so as to permit the referencing of any element by knowing its position in the structure. The selection operation associated with such a structure is said to possess an addressing function. An addressing function for a data structure consisting of n elements is a function which maps the ith element of the data structure onto an integer between one and n. In the case of a vector, the addressing function f maps the ith element onto the integer I, which is a linear addressing function.

20) What exactly does this procedure BUBBLE_SORT (K, N) does? Given a vector K of N elements, this procedure sorts the elements into ascending order using the method just described. The variables PASS and LAST denote the pass counter and position of the last unsorted elements respectively. The variable I is used to index the vector elements. The variable EXCHS is used to count the number of exchanges made on any pass. All variables are integer

Вам также может понравиться