Vous êtes sur la page 1sur 23

UNIT I PRINCIPLES OF OBJECT ORIENTED PROGRAMMING Introduction- Tokens-Expressions-contour Structures Functions in C++, classes and objects, constructors and

d destructors ,operators overloading and type conversions .

PART A

1. What is an identifier? Identifiers are names for various programming elements in c++ program such as variables, arrays, function, structures, union, labels etc., An identifier can be Composed only of uppercase, lower case letter, underscore and digits, but should start only with an alphabet or an underscore. 2. What is a keyword? Keywords are word whose meanings have been already defined in the c compiler. They are also called as reserved words. (ex) main(), if, else, else, if, scanf, printf, switch, for, goto, while etc., 3. Define constant in c++. Constants in c++ refers to fixed values that do not change during execution of a program. 4. Define a variable. A quantity ,Which may vary during execution of a program is called as a variable. 5. What are unary operators? The operators that act upon a single operand are called as unary operators. The unary operators used in c++ are - , ++, -- and sizeof operators. 6. What are binary operators? The operators that act upon two operands are called binary operators. The binary operators used in c++ are +, -, *, / , %, =. etc., 7. What are ternary operators? The operators that act upon three operands are called as ternary operators. The ternary operator available in c++ is (?:).This operator is also referred as conditional operator. 8. What is meant by an expression? An expression is a combination of constant, variable, operators and function calls written in any form as per the syntax of the c++ language.

9.State the difference between c and c++.

C (i). Procedural programming language (ii) Global variable can be declared (iii) Function prototypes are optional (iv) Local variables can be declared only the start of a c program in a c++ program. (v) We can call a main() function, within

C++ Object-oriented programming language. It is an error to declare a variable as global. All functions must be prototyped. Local variables can be declared any where This is not allowed a program.

10. List the various oops concepts

Four main OOP concepts Abstraction creation of well-defined interface for an object, separate from its implementation e.g., key functionalities (init, add, delete, count, print) which can be called independently of knowing how an object is implemented Encapsulation keeping implementation details private i.e., inside the implementation hierarchy an object is defined in terms of other objects Composition => larger objects out of smaller ones

Inheritance => properties of smaller objects are inherited by larger objects Polymorphism use code transparently for all types of same class of object i.e., morph one object into another object within same hierarchy 11. Define class and object Class: It is defined as blueprint or it is a collection of objects Objects: is an instance of a class Almost like struct, the default privacy specification is private whereas with struct, the default privacy specification is public

Example: class point { double x, y; // implicitly private public: void print(); void set( double u, double v ); }; 12. Define inheritance Inheritance Objects are often defined in terms of hierarchical classes with a base class and one or more levels of classes that inherit from the classes that are above it in the hierarchy. For instance, graphics objects might be defined as follows: Syntax for Inheritance class derivedClass : public baseClass { private : // Declarations of additional members, if needed. public: // Declarations of additional members, if needed. protected: // Declarations of additional members, if needed. } 13. Define encapsulation Encapsulation is one of thr most important features of a class.It is the process os combining member functions and the data it manipulates by logically binding the data ane keeping them safe from outside interference.

14. Define abstraction. Creation of well-defined interface for an object, separate from its implementation e.g., key functionalities (init, add, delete, count, print) which can be called independently of knowing how an object is implemented 15. Define polymorphism Polymorphism means having many forms. It allows different objects to respond to the same message in different ways, the response specific to the type of the object. E.g. the message displayDetails() of the Person class should give different results when send to a Student object (e.g. the enrolment number).

16. List out the benefits of oops. Can create new programs faster because we can reuse code Easier to create new data types Easier memory management Programs should be less bug-prone, as it uses a stricter syntax and type checking. `Data hiding', the usage of data by one program part while other program parts cannot access the data Will whiten your teeth 19. List out the application of oops. Client server computing Simulation such as flight simulations. Object-oriented database applications. Artificial intelligence and expert system Computer aided design and manufacturing systems. Real time systems, such as process control, temperature control. 20. Define data hiding. The purpose of the exception handling mechanism is to provide a means to detect and report an exceptional circumstance so that appropriate action can be taken.

21. What is the use of scope resolution operator? In C, the global version of the variable cannot be accessed from within the inner block. C++ resolves this problem by introducing a new operator :: called the scope resolution operator. It is used to uncover a hidden variable. Syntax: :: variable name 22. When will you make a function inline? When the function definition is small, we can make that function an inline function and we can mainly go for inline function to eliminate the cost of calls to small functions. 23. What is overloading? Overloading refers to the use of the same thing for different purposes. There are 2 types of overloading: Function overloading Operator overloading 24. What is the difference between normal function and a recursive function? A recursive function is a function, which call it whereas a normal function does not. Recursive function cant be directly invoked by main function

25. What are objects? How are they created? Objects are basic run-time entities in an object-oriented programming system. The class variables are known as objects. Objects are created by using the syntax: classname obj1,obj2,,objn; (or) during definition of the class: class classname { ------------}obj1,obj2,,objn;

26. List some of the special properties of constructor function. They should be declared in the public section. They are invoked automatically when the objects are created. They do not have return types, not even void and cannot return values. Constructors cannot be virtual. Like other C++ functions, they can have default arguments

27. Describe the importance of destructor. A destructor destroys the objects that have been created by a constructor upon exit from the program or block to release memory space for future use. It is a member function whose name is the same as the class name but is preceded by a tilde. Syntax: ~classname(){ } 28. Define modular programming. It is a process of splitting a large program in to smaller modules to perform the operations fast and, which helps in easy error checking. Modules should be designed, implemented and documented with regard to their possible future use in other projects. 29. What do you mean by friend functions? C++ allows some common functions to be made friendly with any number of classes, thereby allowing the function to have access to the private data of thse classes. Such a function need not be a member of any of these classes. Such common functions are called friend functions.

30. Mention the types of polymorphism. The types of polymorphism are 1.compile time polymorphism 2. runtime polymorphism 31. What are member functions? Functions that are declared within the class definition are referred as member function. 32. Define dynamic binding. Dynamic binding means that the code associated with a given procedure call is not known until the time of the call at run-time. 33. State the difference between a constructor and destructor.

Constructor A constructor is used to initialize the object . No symbol precedes the class name. Constructors can be overloaded.

Destructor A destructor is used for releasing dynamically allocated memory. A tilde symbol precedes the class name. Destructors cannot be overloaded.

34. What is the use of new operator? The new operator is used to allocate contiguous unnamed memory during execution time ane returns a pointer to the start of it. 35. What is the use of static data member? The static data member informs the compiler that only one copy of the data member exit and all objects of the class should share that variable without duplicating it for each instance of the class. 36. What is the different between a pre-increment and post-increment operator. A pre-increment operation such as ++a, increments the value of a by 1,before a is used for computation, while a post-increment operation such as a++, uses the current value or present value of a in the calculation and then increments the value of a by 1. 37. Distinguish between break and continue statement.

Break a) Used to terminate the loops or Used to transfer the control to the Exit loop from a switch. b) The break statement when executed causes Immediate termination of loop

continue Start of loopcontaining it. The continue statement when executed caused immediate .termination of the current iteration of the loop.

38. Distinguish between while and do-while loop.

While loop a) The while loop tests the condition before each iteration b) If the condition fails initially the loop Is skipped entirely

do-while loop The do-while loop tests the condition after the first iteration If the condition fails initially in the first Iteration the loop is executed once

***************************************************************** UNIT II ADVANCED OBJECT ORIENTED PROGRAMMING

Inheritance, Extending classes, Pointers, Virtual functions and polymorphism, File Handling Templates, Exception handling, Manipulating strings. PART A

1. What are the c++ operators that cannot be overloaded? Size operator (sizeof) Scope resolution operator (::) Class member access operators(. , .*) Conditional operator (?:) 2. What is a virtual base class? When a class is declared as virtual c++ takes care to see that only copy of that class is inherited, regardless of how many inheritance paths exist between the virtual base class and a derived class. 3. What is the difference between base class and derived class? The biggest difference between the base class and the derived class is that the derived class contains the data members of both the base and its own data members. The other difference is based on the visibility modes of the data members. 4. What are the rules governing the declaration of a class of multiple inheritance? More than one class name should be specified after the : symbol. Visibility modes must be taken care of. If several inheritance paths are employed for a single derived class the base class must be appropriately declared

5. Mention the types of inheritance. 1. Single inheritance. 2. Multiple inheritance. 3. Hierarchical inheritance. 4. Multilevel inheritance. 5. Hybrid inheritance. 6. Define dynamic binding. Dynamic binding means that the code associated with a given procedure call is not known until the time of the call at run-time. 7. What do u mean by pure virtual functions? A pure virtual function is a function declared in a base class that has no definition relative to the base class. In such cases, the compiler requires each derived class to either define the function or redeclare it as a pure virtual function. A class containing pure virtual functions cannot be used to declare any objects of its own. 8. What are templates? Templates enable us to define generic classes. A template can be considered as a kind of macro. When an object of a specific type is defined for actual use, the template definition for that class is substituted with the required data type. Since a template is defined with a parameter that would be replaced by the specific data type at the time of actual use of the class or function, the templates are sometimes called parameterized classes or functions 9. What is exception handling? The purpose of the exception handling mechanism is to provide a means to detect and report an exceptional circumstance so that appropriate action can be taken. 10. Give the general format of class template. The general format of a class template is: template class classname { // //class member specification //with anonymous type T //wherever appropriate // }; 11. Can we overlaod template function if so explain how. Yes, a template function can be overloaded either by template functions or ordinary functions of its name. in such cases, the overloading resolution is accomplished as follows: 1) Call an ordinary function that has an exact match. 2) Call a template function that could be created with an exact match. 3) Try normal overloading resolution to ordinary functions and call the one that matches.

12. List the kinds of exception. Exceptions are of two kinds namely Synchronous exceptions Asynchronous exceptions 13. What are the errors in synchronous type exceptions? Errors such as out-of-range index and over-flow belong to the synchronous type exceptions. 14. What are the errors in asynchronous type exceptions? The errors that ware caused by errors beyond the control of the program (such as keyboard interrupts) are called asynchronous exceptions. 15. What are the tasks that are performed by the error handling mechanism? The mechanism suggests a separate error handling code that performs the following tasks: 1) 2) 3) 4) Find the problem (Hit the exception). Inform that an error has occurred (Throw the exception). Receive the error information (Catch the exception). Take corrective actions (Handle the exception).

16. Mention the key words used in exception handling. The keywords used in exception handling are throw try catch 17. Give the syntax of exception handling mechanism. The syntax of exception handling mechanism is as follows: try { --------------------throw exception --------------------} catch(type arguments) { ----------------------------------------} -------------------------------------------

18. List the ios format function. The ios format functions are as follows: width() precision() fill() setf() unsetf() 19. List the manipulators. The manipulators are: setw() setprecision() setfill() setiosflags() resetiosflags() 20. Mention the equivalent ios function for manipulators. Manipulator Equivalent ios function setw(int w) width() setprecision(int d) precision() setfill(int c) fill() setiosflags(long f) setf() resetiosflags(long f) unsetf() endl \n 21. Define fill functions. The fill( ) function can be used to fill the unused positions of the field by any desired character rather than by white spaces (by default). It is used in the following form: cout.fill(ch); where ch represents the character which is used for filling the unused positions. For example, the statements cout.fill(*); cout.width(10); cout<<5250<<\n; will produce the following output:

UNIT III DATA STRUCTURES & ALGORITHMS

Algorithm, Analysis, Lists, Stacks and queues, Priority queues-Binary Heap-Application, Heapshashing-hash tables without linked lists 1. Write down the definition of data structures? A data structure is a mathematical or logical way of organizing data in the memory that consider not only the items stored but also the relationship to each other and also it is characterized by accessing functions. 2. Give few examples for data structures? Stacks, Queue, Linked list, Trees, graphs 3. 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. 4. What are the features of an efficient algorithm? Free of ambiguity Efficient in execution time Concise and compact Completeness Definiteness Finiteness 5. List down any four applications of data structures? Compiler design Operating System Database Management system Network analysis 6. What is meant by an abstract data type (ADT)? An ADT is a set of operation. A useful tool for specifying the logical properties of a datatype is the abstract data type.ADT refers to the basic mathematical concept that defines the datatype. Eg.Objects such as list, set and graph along their operations can be viewed as ADT's.

7. What are the operations of ADT? Union, Intersection, size, complement and find are the various operations of ADT. 8. 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. 9. What are the various operations done under list ADT? Print list Insert Make empty Remove Next Previous Find kth 10.What is a Rational number? A Rational number is a number that can be expressed as the quotient of two integers. Operations on Rational number: Creation of rational number from two integers. Addition Multiplication Testing for equality.

11. What are the two parts of ADT? Value definition Operator definition 12. What is a Sequence? A sequence is simply an ordered set of elements.A sequence S is sometimes written as the enumeration of its elements. 13. Define len(S),first(S),last(S),nilseq ? len(S) is the length of the sequence S. first(S) returns the value of the first element of S last(S) returns the value of the last element of S nilseq :Sequence of length 0 is nilseq .ie., contains no element.

14. What are the four basic data types? int,float,char and double 15. What are the two things specified in declaration of variables in C? It specifies the amount of storage that must be set aside for objects declared with that type. How data represented by strings of bits are to be interpreted. 16. What is a pointer? Pointer is a variable, which stores the address of the next element in the list. Pointer is basically a number. 17. What is an array ? Array may be defined abstractly as a finite ordered set of homogenous elements.Finite means there is a specific number of elements in the array. 18. What are the two basic operations that access an array? Extraction: Extraction operation is a function that accepts an array, a ,an index,i,and returns an element of the array. Storing: Storing operation accepts an array , a ,an index i , and an element x. 19. Define Structure? A Structure is a group of items in which each item is identified by its own identifier ,each of which is known as a member of the structure. 20. Define Union ? Union is collection of Structures ,which permits a variable to be interpreted in several different ways. 21. Define Automatic and External variables? Automatic variables are variables that are allocated storage when the function is invoked. External variables are variables that are declared outside any function and are allocated storage at the point at which they are first encountered for the remeinder of the programs execution. 22. Define Recursion? Recursion is a function calling itself again and again. 23. What is a Fibonacci sequence? Fibonacci sequence is the number of integers 0,1,1,2,3,5,8,13,21,34,. Each element in this sequence is the sum of the two preceding elements.

24. What is a Stack? A Stack is an ordered collection of items into which new items may be inserted and from which items may be deleted at one end, called the top of the stack. The other name of stack isLast-in -First-out list. 23. What are the two operations of Stack? _ PUSH _ POP 24. Write postfix from of the expression A+B-C+D? A-B+C-D+ 25. What is a Queue? A Queue is an ordered collection of items from which items may be deleted at one end called the front of the queue and into which tems may be inserted at the other end called rear of the queue.Queue is called as Firstin-FirstOut(FIFO). 26. What is a Priority Queue? Priority queue is a data structure in which the intrinsic ordering of the elements does determine the results of its basic operations. Ascending and Descending priority queue are the two types of Priority queue. 27. What are the different ways to implement list? Simple array implementation of list Linked list implementation of list 28. 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 29. What is a linked list? Linked list is a kind of series of data structures, which are not necessarily adjacent in memory. Each structure contain the element and a pointer to a record containing its successor. 30.Name the two fields of Linked list? Info field Next field

31. 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. 32.Name the three fields of Doubly Linked list? Info field Left field Right field 33. 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. 34. 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. 35. List three examples that uses linked list? Polynomial ADT Radix sort Multi lists 36. Give some examples for linear data structures? Stack Queue 37. Write postfix from of the expression A+B-C+D? A-B+C-D 38. 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. 39. 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

40. 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. 41. 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 insert and remove. 42. What is a circular queue? The queue, which wraps around upon reaching the end of the array is called as circular queue. 43. Define max heap? A heap in which the parent has a larger key than the child's is called a max heap. 44. Define min heap? A heap in which the parent has a smaller key than the child is called a min heap. 45. What is the need for hashing? Hashing is used to perform insertions, deletions and find in constant average time. 46. Define hash function? Hash function takes an identifier and computes the address of that identifier in the hash table using some function. 47. 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 analytic 48. What are the problems in hashing? a.Collision b.Overflow

49. 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.

UNIT IV NONLINEAR DATA STRUCTURES

Trees -Binary trees, search tree ADT, AVL trees, Graph Algorithms-Topological sort, shortest path algorithm network flow problems-minimum spanning tree - Introduction to NP completeness. 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 whille all other nodes have indegree 1 . 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 from of expression. b.In-order traversal-yields infix form of expression. c.Post-order traversal-yields postfix from 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. 17.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). 18. 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 x connects the nodes u and v. 19. What is a directed graph? A graph in which every edge is directed is called a directed graph. 20. What is a undirected graph? A graph in which every edge is undirected is called a directed graph. 21. What is a loop? An edge of a graph which connects to itself is called a loop or sling. 22.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.

23. What is a weighted graph? A graph in which weights are assigned to every edge is called a weighted graph. 24. 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. 25. 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. 26. Define path in a graph? The path in a graph is the route taken to reach terminal node from a starting node. 27. 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. 28. What is a cycle or a circuit? A path which originates and ends in the same node is called a cycle or circuit. 29. What is an acyclic graph? A simple diagram which does not have any cycles is called an acyclic graph. 30. 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. 31. 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. 32. Name the different ways of representing a graph? a.Adjacency matrix b.Adjacency list 33. 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.

34. What are the two traversal strategies used in traversing a graph? a.Breadth first search b.Depth first search 35. 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. 36. 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. ************************************************************************* UNIT V SORTING AND SEARCHING Sorting Insertion sort, Shell sort, Heap sort, Merge sort, Quick sort, Indirect sorting, Bucket sort, Introduction to Algorithm Design Techniques Greedy algorithm (Minimum Spanning Tree), Divide and Conquer (Merge Sort), Dynamic Programming (All pairs Shortest Path Problem). 1.What is meant by sorting? Ordering the data in an increasing or decreasing fashion according to some relationship among the data item is called sorting. 2. What are the two main classifications of sorting based on the source of data? a.Internal sorting b.External sorting 3. What is meant by external sorting? External sorting is a process of sorting in which large blocks of data stored in storage devices are moved to the main memory and then sorted. 4. What is meant by internal sorting? Internal sorting is a process of sorting the data in the main memory. 5. What are the various factors to be considered in deciding a sorting algorithm? a.Programming time b.Execution time of the program

c.Memory needed for program environment 6. What is the main idea behind insertion sort? The main idea of insertion sort is to insert in the ith pass the ith element in A (1) A (2)...A (i) in its rightful place. 7. What is the main idea behind insertion sort? The main idea behind the selection sort is to find the smallest element among in A (I) A (J+1)...A (n) and then interchange it with a (J). This process is then repeated for each value of J. 8. What is the basic of shell sort? Instead of sorting the entire array at once, it is first divide the array into smaller segments, which are then separately sorted using the insertion sort. 9. What is the other name for shell sort? Diminishing increment sort. 10. What is the purpose of quick sort? The purpose of the quick sort is to move a data item in the correct direction, just enough for to reach its final place in the array. 11. What is the advantage of quick sort? Quick sort reduces unnecessary swaps and moves an item to a greater distance, in one move. 12. What is the average efficiency of heap sort? The average efficiency of heap sort is 0 (n(log2 n)) where, n is the number of elements sorted. 13. Define segment? When large blocks of data are to be sorted, only a portion of the block or file is loaded in the main memory of the computer since, it cannot hold the entire block. This small portion of file is called a segment. 14. Name some of the external sorting methods? a.Polyphase merging b.Oscillation sorting c.Merge sorting

15. When is a sorting method said to be stable? A sorting method is said to be stable, it two data items of matching values are guaranteed to be not rearranged with respect to each other as the algorithm progresses. 16. Name some simple algorithms used in external sorting? a.Multiway merge b.Polyphase merge c.Replacement selection 17. When can we use insertion sort? Insertion sort is useful only for small files or very nearly sorted files. 18. How many passes are required fork-way merging? The number of passes required using k-way merging is [log k (n/m)] because the N H S get k times as large in each pass.

Vous aimerez peut-être aussi