Technical MCQ By Mcs'17

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By MCS17
M
MCS17
Community Contributor
Quizzes Created: 1 | Total Attempts: 158
| Attempts: 158
SettingsSettings
Please wait...
  • 1/60 Questions

        Which of the following case does not exist in complexity theory

    •     Best case
    •     Worst case
    •     Average case
    •     Null case
Please wait...
Technical MCQ By Mcs
About This Quiz

Technical MCQ by MCS'17 covers key topics in database management, including relational algebra, transaction properties, recovery measures, and data modeling.


Quiz Preview

  • 2. 

    Tree structures are used to store data in

    • Network model

    • Relational model

    • Hierarchical model

    • File based system

    Correct Answer
    A. Hierarchical model
    Explanation
    Tree structures are used to store data in a hierarchical model. In a hierarchical model, data is organized in a tree-like structure with parent-child relationships. Each parent can have multiple children, but each child can have only one parent. This model is commonly used in systems where data has a one-to-many relationship, such as an organizational chart or a file system. In a hierarchical model, data can be accessed quickly and efficiently by following the parent-child relationships.

    Rate this question:

  • 3. 

        Which of the following data structure is linear data structure?

    •     Trees

    •     Graphs

    •     Arrays

    •     None of above

    Correct Answer
    A.     Arrays
    Explanation
    Arrays are a linear data structure because they store data elements in a contiguous memory location. Each element in an array can be accessed by its index, which is a linear sequence of integers starting from 0. Arrays have a fixed size and can store elements of the same data type. They are efficient for accessing and retrieving elements, but not for inserting or deleting elements in the middle of the array.

    Rate this question:

  • 4. 

    Which of the following is not a property of transactions?

    • Atomicity

    • Concurrency

    • Isolation

    • Durability

    Correct Answer
    A. Concurrency
    Explanation
    Concurrency is not a property of transactions. Transactions ensure atomicity, which means that they are either executed in their entirety or not at all. Isolation ensures that transactions are executed independently and do not interfere with each other. Durability ensures that once a transaction is committed, its changes are permanent. However, concurrency refers to the ability of multiple transactions to execute simultaneously without interfering with each other, which is not a property of transactions.

    Rate this question:

  • 5. 

    Checkpoints are a part of

    • Recovery measures

    • Security measures.

    • Concurrency measures

    • Authorization measures.

    Correct Answer
    A. Recovery measures
    Explanation
    Checkpoints are a part of recovery measures. In computer systems, a checkpoint refers to a specific point in time where the system's state is saved. This allows for the system to be restored to that point in case of a failure or error. Recovery measures are put in place to ensure the system can recover from such failures and continue functioning properly. Checkpoints play a crucial role in this process by providing a reference point for restoring the system to a known, stable state.

    Rate this question:

  • 6. 

        The operation of processing each element in the list is known as

    •     Sorting

    •     Merging

    •     Inserting

    •     Traversal

    Correct Answer
    A.     Traversal
    Explanation
    Traversal refers to the process of visiting and accessing each element in a list or data structure. It involves iterating through the elements one by one, usually in a linear manner, and performing some operation on each element. In this context, the operation mentioned in the question is the processing of each element in the list, which aligns with the concept of traversal. Sorting, merging, and inserting are different operations that may be performed on a list, but they are not specifically related to the process of accessing each element.

    Rate this question:

  • 7. 

    The clause in SQL that specifies that the query result should be sorted in ascending or descending order based on the values of one or more columns is

    • View

    • Order by

    • Group by

    • Having

    Correct Answer
    A. Order by
    Explanation
    The clause in SQL that specifies that the query result should be sorted in ascending or descending order based on the values of one or more columns is "Order by". This clause is used to sort the result set in either ascending (default) or descending order. It allows the user to specify one or more columns to sort by, and the sorting is done based on the values in those columns.

    Rate this question:

  • 8. 

    The _______ memory allocation function modifies the previous allocated space.

    • calloc

    • free

    • malloc

    • realloc

    Correct Answer
    A. realloc
    Explanation
    The realloc memory allocation function is used to modify the previously allocated space. It allows for resizing the memory block that was previously allocated using malloc, calloc, or realloc itself. The function takes the pointer to the previously allocated block, the new size of the block, and returns a pointer to the modified block. This function is useful when there is a need to change the size of the allocated memory dynamically, such as when adding or removing elements from an array.

    Rate this question:

  • 9. 

        Two main measures for the efficiency of an algorithm are

    •     Processor and memory

    •     Complexity and capacity

    •     Time and space

    •     Data and space

    Correct Answer
    A.     Time and space
    Explanation
    The two main measures for the efficiency of an algorithm are time and space. Time refers to the amount of time it takes for an algorithm to run and complete its task, while space refers to the amount of memory or storage that the algorithm requires to execute. These measures are important in evaluating the performance and resource utilization of an algorithm. By considering both time and space, developers can assess how efficiently an algorithm utilizes computational resources and make informed decisions about its implementation.

    Rate this question:

  • 10. 

        The Average case occur in linear search algorithm

    •     When Item is somewhere in the middle of the array

    •     When Item is not in the array at all

    •     When Item is the last element in the array

    •     When Item is the last element in the array or is not there at all

    Correct Answer
    A.     When Item is somewhere in the middle of the array
    Explanation
    In linear search algorithm, the average case occurs when the item being searched for is somewhere in the middle of the array. This means that on average, the algorithm will have to search through half of the elements in the array before finding the desired item. This is because linear search checks each element in the array one by one until it finds a match. Therefore, when the item is in the middle, the algorithm will have to search through approximately half of the elements before finding the item.

    Rate this question:

  • 11. 

        Finding the location of the element with a given value is:

    •     Traversal

    •     Search

    •     Sort

    •     None of above

    Correct Answer
    A.     Search
    Explanation
    The correct answer is "Search" because finding the location of an element with a given value involves searching through a data structure or collection to locate the desired value. Traversal refers to the process of accessing and visiting each element in a data structure, while sorting involves arranging elements in a specific order. None of the above options accurately describe the process of locating an element with a given value.

    Rate this question:

  • 12. 

    The rule that a value of a foreign key must appear as a value of some specific table is called

    • Referential constraint

    • Index.

    • Integrity constraint

    • Functional dependency.

    Correct Answer
    A. Referential constraint
    Explanation
    A referential constraint is a rule that ensures that the value of a foreign key in a table must appear as a value in another specific table. It is used to maintain the integrity and consistency of data in a relational database by enforcing relationships between tables. This constraint helps to prevent orphaned records and ensures that data remains accurate and valid.

    Rate this question:

  • 13. 

    What is data integrity?

    • It is the data contained in database that is non redundant.

    • It is the data contained in database that is accurate and consistent.

    • It is the data contained in database that is secured.

    • It is the data contained in database that is shared.

    Correct Answer
    A. It is the data contained in database that is accurate and consistent.
    Explanation
    Data integrity refers to the reliability and consistency of data stored in a database. It ensures that the data is accurate, complete, and consistent throughout its lifecycle. This means that the data is free from errors, duplications, and inconsistencies. Maintaining data integrity is crucial for ensuring the quality and reliability of information in a database, as it allows users to trust the data and make informed decisions based on it.

    Rate this question:

  • 14. 

    What is the output of the following code? #include void main() { int s=0; while(s++ # define a 10 converted by Web2PDFConvert.com main() { printf("%d..",a); foo(); printf("%d",a); } void foo() { #undef a #define a 50 }

    • 10..10

    • 10..50

    • Error

    Correct Answer
    A. Error
    Explanation
    The code will result in an error because the variable "a" is undefined when it is called in the printf statement in the main function. This is because the "#undef a" statement in the foo function removes the definition of "a" and the subsequent "#define a 50" statement only applies within the foo function. Therefore, when "a" is called in the main function, it is not recognized and an error occurs.

    Rate this question:

  • 15. 

        The complexity of merge sort algorithm is

    •     O(n)

    •     O(log n)

    •     O(n2)

    •     O(n log n)

    Correct Answer
    A.     O(n log n)
    Explanation
    The complexity of the merge sort algorithm is O(n log n). This means that the time it takes to sort a list of n elements using merge sort grows at a rate that is proportional to n multiplied by the logarithm of n. This is considered to be an efficient sorting algorithm as it has a better time complexity compared to other sorting algorithms like bubble sort or insertion sort, which have a time complexity of O(n2).

    Rate this question:

  • 16. 

    What will be the output of the following arithmetic expression ? 5+3*2%10-8*6

    • -37

    • -42

    • -32

    • -28

    Correct Answer
    A. -37
    Explanation
    The given arithmetic expression follows the order of operations, which is parentheses, exponents, multiplication and division (from left to right), and addition and subtraction (from left to right). First, the multiplication operation is performed, resulting in 3*2 = 6. Then, the modulo operation is performed, resulting in 6%10 = 6. Next, the addition operation is performed, resulting in 5+6 = 11. Finally, the subtraction operation is performed, resulting in 11-8 = 3. Since there are no parentheses or exponents in the expression, the final result is 3, which does not match any of the given answer choices. Therefore, the correct answer is not available.

    Rate this question:

  • 17. 

        Linked lists are best suited

    •     for relatively permanent collections of data

    •     for the size of the structure and the data in the structure are constantly changing

    •     for both of above situation

    •     for none of above situation

    Correct Answer
    A.     for the size of the structure and the data in the structure are constantly changing
    Explanation
    Linked lists are best suited for situations where the size of the structure and the data in the structure are constantly changing. This is because linked lists allow for efficient insertion and deletion of elements at any position in the list, without the need to shift or resize the entire structure. The dynamic nature of linked lists makes them ideal for situations where the collection of data is frequently modified, as they can easily accommodate changes in size and content without incurring significant overhead.

    Rate this question:

  • 18. 

        When determining the efficiency of algorithm the time factor is measured by

    •     Counting microseconds

    •     Counting the number of key operations

    •     Counting the number of statements

    •     Counting the kilobytes of algorithm

    Correct Answer
    A.     Counting the number of key operations
    Explanation
    The efficiency of an algorithm is measured by counting the number of key operations. Key operations refer to the fundamental operations or steps performed in the algorithm that directly contribute to its execution time. By counting these key operations, we can analyze and compare the efficiency of different algorithms in terms of their time complexity. Counting microseconds, the number of statements, or the kilobytes of the algorithm are not accurate measures of time factor in determining efficiency.

    Rate this question:

  • 19. 

        The complexity of linear search algorithm is

    •     O(n)

    •     O(log n)

    •     O(n2)

    •     O(n log n)

    Correct Answer
    A.     O(n)
    Explanation
    The complexity of the linear search algorithm is O(n) because it has to iterate through each element in the worst case scenario. This means that the time it takes to find the desired element increases linearly with the size of the input. It does not have any logarithmic or quadratic components, which are represented by O(log n) and O(n^2) respectively. O(n log n) is the complexity of certain sorting algorithms, but it is not applicable to linear search.

    Rate this question:

  • 20. 

        The elements of an array are stored successively in memory cells because

    •     by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated

    •     the architecture of computer memory does not allow arrays to store other than serially

    •     both of above

    •     none of above

    Correct Answer
    A.     by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated
    Explanation
    The elements of an array are stored successively in memory cells because by this way, the computer can keep track of only the address of the first element. The addresses of other elements can be calculated by adding the appropriate offset to the address of the first element. This allows for efficient memory management and access to array elements.

    Rate this question:

  • 21. 

        Arrays are best data structures

    •     for relatively permanent collections of data

    •     for the size of the structure and the data in the structure are constantly changing

    •     for both of above situation

    •     for none of above situation

    Correct Answer
    A.     for relatively permanent collections of data
    Explanation
    Arrays are best data structures for relatively permanent collections of data because arrays have a fixed size and are efficient for accessing elements by their index. They provide constant time access to any element in the array, making them suitable for situations where the size of the structure and the data in the structure are not constantly changing. Arrays are also useful when the data needs to be stored in a specific order and does not require frequent modifications or resizing.

    Rate this question:

  • 22. 

    What are the desirable properties of a decomposition

    • Partition constraint

    • Dependency preservation

    • Redundancy

    • Security.

    Correct Answer
    A. Dependency preservation
    Explanation
    Dependency preservation is a desirable property of a decomposition because it ensures that the functional dependencies present in the original relation are preserved in the decomposed relations. This means that any dependencies that existed between attributes in the original relation will still hold true in the decomposed relations. This property is important because it ensures that the integrity and consistency of the data is maintained during the decomposition process.

    Rate this question:

  • 23. 

        Which of the following data structure is not linear data structure?

    •     Arrays

    •     Linked lists

    •     Both of above

    •     None of above

    Correct Answer
    A.     None of above
    Explanation
    The correct answer is "None of above". This means that both arrays and linked lists are linear data structures. Arrays are a collection of elements of the same data type that are stored in contiguous memory locations. Linked lists are a collection of nodes where each node contains a data element and a reference to the next node. Both arrays and linked lists allow for sequential access to their elements, making them linear data structures.

    Rate this question:

  • 24. 

        In linear search algorithm the Worst case occurs when

    •     The item is somewhere in the middle of the array

    •     The item is not in the array at all

    •     The item is the last element in the array

    •     The item is the last element in the array or is not there at all

    Correct Answer
    A.     The item is the last element in the array or is not there at all
    Explanation
    In linear search algorithm, the worst case occurs when the item is the last element in the array or is not there at all. This is because in linear search, we iterate through each element of the array sequentially until we find the desired item or reach the end of the array. Therefore, if the item is the last element, we have to iterate through the entire array before finding it. Similarly, if the item is not present in the array, we have to iterate through the entire array to confirm its absence.

    Rate this question:

  • 25. 

        Each array declaration need not give, implicitly or explicitly, the information about

    •     the name of array

    •     the data type of array

    •     the first data from the set to be stored

    •     the index set of the array

    Correct Answer
    A.     the first data from the set to be stored
    Explanation
    Each array declaration does not need to specify the first data from the set to be stored. The declaration only needs to provide information about the name of the array, the data type of the array, and the index set of the array. The first data from the set to be stored can be assigned later when the array is initialized or populated with values.

    Rate this question:

  • 26. 

    What is a disjoint less constraint?

    • It requires that an entity belongs to no more than one level entity set.

    • The same entity may belong to more than one level.

    • The database must contain an unmatched foreign key value.

    • An entity can be joined with another entity in the same level entity set.

    Correct Answer
    A. It requires that an entity belongs to no more than one level entity set.
    Explanation
    A disjoint less constraint is a requirement that an entity can only belong to one level entity set. This means that the same entity cannot be associated with multiple levels. For example, if we have a database with different levels of employees (e.g., junior, senior, manager), a disjoint less constraint would ensure that an employee can only be part of one level, such as either junior or senior, but not both. This constraint helps maintain data integrity and avoids confusion in the database.

    Rate this question:

  • 27. 

    What will be the output of the following statements? int a=5,b=6,c=9,d; d=(ac?1:2):(c>b?6:8)); printf("%d",d);

    • 1

    • 2

    • 6

    • Error

    Correct Answer
    A. Error
    Explanation
    The given code has a syntax error. There is an extra closing parenthesis ")" after the ternary operator. The correct code should be: d=(a>c?1:2):(c>b?6:8); printf("%d",d); This code will result in a compilation error.

    Rate this question:

  • 28. 

    The language that requires a user to specify the data to be retrieved without specifying exactly how to get it is

    • Procedural DML

    • Non-Procedural DML

    • Procedural DDL

    • Non-Procedural DDL

    Correct Answer
    A. Non-Procedural DML
    Explanation
    Non-Procedural DML is the correct answer because it allows the user to specify the data to be retrieved without specifying exactly how to get it. Non-Procedural DML focuses on what data is needed, rather than how to retrieve it. This type of language is often used in high-level programming languages and query languages, where the user only needs to specify the desired outcome and the system takes care of the implementation details.

    Rate this question:

  • 29. 

    What will be the output of the following statement ? printf( 3 + "goodbye");

    • Goodbye

    • Odbye

    • Bye

    • dbye

    Correct Answer
    A. dbye
    Explanation
    The given statement printf(3 + "goodbye") is adding the integer 3 to the string "goodbye". In C programming, when a number is added to a string, it results in a pointer to a character in the string. In this case, adding 3 to "goodbye" will result in a pointer to the fourth character of the string, which is 'd'. Therefore, the output of the statement will be "dbye".

    Rate this question:

  • 30. 

    Relational Algebra does not have

    • Selection operator

    • Projection operator

    • Aggregation operators

    • Division operator

    Correct Answer
    A. Aggregation operators
    Explanation
    The correct answer is "Aggregation operators." Relational Algebra is a formal language used to query and manipulate relational databases. It includes various operators such as selection, projection, and division, which are used to perform specific operations on the data. However, aggregation operators are not part of the Relational Algebra. Aggregation operators are typically used in SQL queries to perform calculations on groups of data, such as finding the sum, average, or maximum value.

    Rate this question:

  • 31. 

    A relation is in ____________ if an attribute of a composite key is dependent on an attribute of other composite key.

    • 2NF

    • 3NF

    • BCNF

    • 1NF

    Correct Answer
    A. 3NF
    Explanation
    In 3NF (Third Normal Form), an attribute of a composite key is dependent on an attribute of another composite key. This means that the relation has been normalized to eliminate any transitive dependencies, ensuring that each non-key attribute is functionally dependent on the primary key. This level of normalization helps to minimize redundancy and improve data integrity in the database.

    Rate this question:

  • 32. 

    In an E-R diagram double lines indicate

    • Total participation

    • Multiple participation.

    • Cardinality N

    • None of the above.

    Correct Answer
    A. Total participation
    Explanation
    Double lines in an E-R diagram indicate total participation. Total participation means that every entity in one entity set must participate in a relationship with entities in another entity set. In other words, it ensures that every instance of an entity set is associated with at least one instance of another entity set. Double lines are used to represent this constraint in the E-R diagram.

    Rate this question:

  • 33. 

    Which of the following relational algebra operations do not require the participating tables to be union-compatible?

    • Union

    • Intersection

    • Difference

    • Join

    Correct Answer
    A. Join
    Explanation
    The join operation in relational algebra does not require the participating tables to be union-compatible. Join combines rows from two or more tables based on a common attribute and creates a new table. It matches the values of the common attribute in the tables and combines the rows that have matching values. Unlike union, intersection, and difference operations, join does not require the tables to have the same number or types of columns.

    Rate this question:

  • 34. 

        When determining the efficiency of algorithm, the space factor is measured by

    •     Counting the maximum memory needed by the algorithm

    •     Counting the minimum memory needed by the algorithm

    •     Counting the average memory needed by the algorithm

    •     Counting the maximum disk space needed by the algorithm

    Correct Answer
    A.     Counting the maximum memory needed by the algorithm
    Explanation
    The efficiency of an algorithm is determined by measuring the space factor, which refers to the amount of memory needed by the algorithm. In this case, the correct answer is counting the maximum memory needed by the algorithm. This means that we consider the highest amount of memory that the algorithm requires during its execution. By counting the maximum memory usage, we can evaluate the algorithm's efficiency in terms of space utilization and make comparisons with other algorithms.

    Rate this question:

  • 35. 

    Immediate database modification technique uses

    • Both undo and redo

    • Undo but no redo

    • Redo but no undo

    • Neither undo nor redo.

    Correct Answer
    A. Both undo and redo
    Explanation
    The immediate database modification technique uses both undo and redo. Undo is used to reverse the changes made to the database in case of a rollback or an error, while redo is used to reapply the changes made to the database in case of a commit or a crash. By using both undo and redo, the database can maintain consistency and ensure that any changes made to the database are properly recorded and can be reversed if necessary.

    Rate this question:

  • 36. 

    What isDequeue?

    • Elements can be added from front

    • Elements can be added to or removed from either the front or rear

    • Elements can be added from rear

    • None of the above

    Correct Answer
    A. Elements can be added to or removed from either the front or rear
    Explanation
    A Dequeue (Double Ended Queue) is a data structure in which elements can be added to or removed from either the front or rear. This means that elements can be added or removed from both ends of the queue, providing flexibility in accessing and manipulating the elements. This makes Dequeue a versatile data structure for various applications that require efficient insertion and deletion operations at both ends.

    Rate this question:

  • 37. 

    What will be the output of the following statement ? int a=10; printf("%d &i",a,10);

    • Error

    • 10

    • 10 10

    • none of these

    Correct Answer
    A. none of these
    Explanation
    The output of the given statement will be "10 &i". This is because the printf() function is used to print the value of the variable "a" followed by the string "&i". The "%d" format specifier is used to print the value of the integer variable, which in this case is 10. The "&i" is simply a string that will be printed as it is.

    Rate this question:

  • 38. 

    The operation which is not considered a basic operation of relational algebra is

    • Join

    • Selection

    • Union

    • Cross product

    Correct Answer
    A. Join
    Explanation
    The basic operations of relational algebra include Selection, Projection, Union, Difference, Intersection, and Cartesian Product. Join is not considered a basic operation because it combines two relations based on a common attribute, creating a new relation. It is a more complex operation that requires the comparison of values in the common attribute and the merging of tuples from both relations.

    Rate this question:

  • 39. 

    Precedence graphs help to find a AC14/AT11 Database Management Systems 2

    • Serializable schedule

    • Recoverable schedule

    • Deadlock free schedule

    • Cascadeless schedule

    Correct Answer
    A. Serializable schedule
    Explanation
    Precedence graphs help to find a Serializable schedule. A Serializable schedule is a schedule in which the outcome is the same as if the transactions were executed one at a time in some order. Precedence graphs are used to determine if a schedule is serializable by representing the transactions as nodes and the dependencies between them as edges. If the graph is acyclic, then the schedule is serializable. If there is a cycle in the graph, then the schedule is not serializable. Therefore, precedence graphs are a useful tool for analyzing and determining the serializability of schedules in database management systems.

    Rate this question:

  • 40. 

    The statement printf("%c", 100); will print?

    • prints 100

    • print garbage

    • prints ASCII equivalent of 100

    • None of the above

    Correct Answer
    A. prints ASCII equivalent of 100
    Explanation
    The statement printf("%c", 100); will print the ASCII equivalent of the number 100, which is the character 'd'.

    Rate this question:

  • 41. 

    It is an abstraction through which relationships are treated as higher level entities

    • Generalization

    • Specialization

    • Aggregation

    • Inheritance

    Correct Answer
    A. Aggregation
    Explanation
    Aggregation is the correct answer because it refers to the concept of treating relationships between objects as higher-level entities. In aggregation, objects can be composed of other objects, forming a whole-part relationship. This allows for a more abstract representation of relationships, where the focus is on the overall structure or composition rather than the specific details of individual objects. Generalization and specialization are related to inheritance, which involves creating subclasses based on a superclass. While inheritance is a form of abstraction, it is not directly related to treating relationships as higher-level entities.

    Rate this question:

  • 42. 

    Fifth Normal form is concerned with

    • Functional dependency

    • Multivalued dependency

    • Join dependency

    • Domain-key.

    Correct Answer
    A. Join dependency
    Explanation
    Fifth Normal form (5NF) is concerned with join dependency. Join dependency occurs when a relation can be decomposed into multiple smaller relations, and the original relation can be reconstructed by joining these smaller relations. In 5NF, all join dependencies are eliminated, resulting in a more efficient and flexible database design. This normalization form ensures that the database schema is free from redundancy and anomalies, leading to improved data integrity and maintainability.

    Rate this question:

  • 43. 

    Block-interleaved distributed parity is RAID level

    • 2

    • 3

    • 4

    • 5

    Correct Answer
    A. 5
    Explanation
    Block-interleaved distributed parity is a RAID level where data is divided into blocks and distributed across multiple drives, along with parity information. This allows for improved fault tolerance and data protection. In this RAID level, each block of data is striped across multiple drives, and parity information is calculated and distributed across the drives as well. This ensures that if a drive fails, the data can be reconstructed using the parity information from the remaining drives. Therefore, the correct answer is 5.

    Rate this question:

  • 44. 

    What will be output if you will compile and execute the following c code? #define call(x) #x void main(){ printf("%s",call(c/c++)); }

    • C

    • C++

    • #c/c++

    • C/c++

    • Compiler error

    Correct Answer
    A. C/c++
    Explanation
    The code is using the # operator in the macro definition. The # operator is used to convert the argument into a string literal. In this case, the argument is "c/c++". So when the code is executed, the printf statement will print the string "c/c++" as the output.

    Rate this question:

  • 45. 

    Number of binary trees formed with 5 nodes are

    • 30

    • 36

    • 108

    • 42

    Correct Answer
    A. 42
    Explanation
    The number of binary trees that can be formed with 5 nodes is 42. This can be determined using the formula for the number of binary trees with n nodes, which is given by the Catalan number C(n) = (2n)! / ((n+1)! * n!). Plugging in n=5, we get C(5) = (2*5)! / ((5+1)! * 5!) = 10! / (6! * 5!) = 42. Therefore, the correct answer is 42.

    Rate this question:

  • 46. 

        The complexity of Binary search algorithm is

    •     O(n)

    •     O(log )

    •     O(n2)

    •     O(n log n)

    Correct Answer
    A.     O(log )
    Explanation
    The complexity of the Binary search algorithm is O(log n). This means that the time it takes to execute the algorithm increases logarithmically with the size of the input. In other words, as the number of elements in the input increases, the time taken by the algorithm to find the target element will increase at a much slower rate compared to linear search algorithms. This is because the binary search algorithm repeatedly divides the search space in half, reducing the number of elements to be searched in each iteration. Therefore, the time complexity of the binary search algorithm is logarithmic.

    Rate this question:

  • 47. 

    What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?

    • The element will be set to 0

    • The compiler would report an error

    • The program may crash if some important data gets overwritten

    • The array size would appropriately grow

    Correct Answer
    A. The program may crash if some important data gets overwritten
    Explanation
    If a value is assigned to an array element whose subscript exceeds the size of the array, it may lead to overwriting important data in the program. This can cause the program to crash as it tries to access memory that it is not supposed to. Therefore, the correct answer is that the program may crash if some important data gets overwritten.

    Rate this question:

  • 48. 

    Main() { struct { int i; }xyz; (*xyz)->i=10; printf("%d",xyz.i); } What is the output of thisprogram?

    • program will not compile

    • 10

    • god only knows

    • address of I

    Correct Answer
    A. 10
    Explanation
    The program will output 10. This is because the program defines a structure called xyz with a member variable i. It then assigns the value 10 to the member variable i using the pointer to the structure. Finally, it prints the value of xyz.i, which is 10.

    Rate this question:

  • 49. 

        For an algorithm the complexity of the average case is

    •     Much more complicated to analyze than that of worst case

    •     Much more simpler to analyze than that of worst case

    •     Sometimes more complicated and some other times simpler than that of worst case

    •     None or above

    Correct Answer
    A.     Much more complicated to analyze than that of worst case
    Explanation
    The complexity of the average case for an algorithm is much more complicated to analyze than that of the worst case. This is because the worst case scenario represents the maximum amount of time or resources that the algorithm can take, while the average case takes into account the distribution of inputs and their likelihood of occurring. Analyzing the average case requires considering all possible inputs and their probabilities, making it a more complex task compared to analyzing the worst case.

    Rate this question:

Quiz Review Timeline (Updated): Mar 20, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 02, 2017
    Quiz Created by
    MCS17
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.