Pop operation removes the top most element in the stack i.e. If the stack is filled completely and trying to perform push operation stack – overflow can happen.ģ2.Process of removing an element from stack is called _Įxplanation: Elements in the stack are removed using pop operation. Process of inserting an element in stack is called _Įxplanation: Push operation allows users to insert elements in the stack. Wastage will occur in memory.Ī) Objects of mixed data types can be storedĬ) Index of first element of an array is 1ĭ) Easier to store elements of same data typeĮxplanation: Arrays store elements of the same data type and present in continuous memory locations.ģ1. If we insert elements less than the allocated size, unoccupied positions can’t be used again. What is the output of the following Java code?Įxplanation: Trying to access an element beyond the limits of an array gives ArrayIndexOutOfBoundsException.Ģ7.When does the ArrayIndexOutOfBoundsException occur?Įxplanation: ArrayIndexOutOfBoundsException is a run-time exception and the compilation is error-free.Ģ8.Which of the following concepts make extensive use of arrays?Įxplanation: Whenever a particular memory location is referred to, it is likely that the locations nearby are also referred, arrays are stored as contiguous blocks in memory, so if you want to access array elements, spatial locality makes it to access quickly.Ī) Data structure like queue or stack cannot be implementedī) There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated sizeĬ) Index value of an array can be negativeĮxplanation: Arrays are of fixed size. Explanation: Array indexing starts from 0. Public static void main ( String args )Ģ6. Which of the following is true about the characteristics of abstract data types?ġ2.Which of the following data structures are indexed structures?ġ3.Operations on a data structure may be ….ġ4.Which of the following are the operations applicable an primitive data structures?ġ5.Which of the following data structure is non-linear type?ġ6.The indirect change of the values of a variable in one module by another module is calledġ7.The operation of processing each element in the list is known asġ8.Finding the location of the element with a given value is:ġ9.Which of the following data structure can’t store the non-homogeneous data elements?Ģ0.Which of the following data structures store the homogeneous data elements?Ģ1.Which of these best describes an array?Ī) A data structure that shows a hierarchical behaviorĮxplanation: Array contains elements only of the same type.Įxplanation: This is the syntax to initialize an array in C.Ģ3.How do you instantiate an array in Java?Įxplanation: Note that int arr is declaration whereas int arr = new int is to instantiate an array.Ģ4.Which of the following is the correct way to declare a multidimensional array in Java?Įxplanation: The syntax to declare multidimensional array in java is either int arr or int arr Ģ5.What is the output of the following Java code? When new data are to be inserted into a data structure, but there is not available space this situation is usually called ….ġ1. Match the following.a) Completeness i) How long does it take to find a solutionb) Time Complexity ii) How much memory need to perform the search.c) Space Complexity iii) Is the strategy guaranteed to find the solution when there in one.ġ0. …………… is not the component of data structure.Ĥ.Which of the following is not the part of ADT description?ĥ.Which of the following is non-linear data structure?Ħ.Which of the following data structure is non linear type?ħ.Which of the following data structure is linear type?Ĩ.To represent hierarchical relationship between elements, Which data structure is suitable?ĩ. level is where the model becomes compatible executable code.ģ. 1.Which of the following is/are the levels of implementation of data structureĢ.……………….
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |