Data Structures And Algorithmic Concepts! Trivia Quiz

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 Seelak123
S
Seelak123
Community Contributor
Quizzes Created: 1 | Total Attempts: 392
| Attempts: 392 | Questions: 80
Please wait...
Question 1 / 80
0 %
0/100
Score 0/100
1. An Array is what kind of data structure

Explanation

An array is a linear data structure because it stores elements in a sequential manner, where each element is accessed by its index. The elements in an array are stored in contiguous memory locations, allowing for efficient access and retrieval of elements. This linear arrangement of elements makes it easy to perform operations like traversal, insertion, and deletion. Therefore, the correct answer is linear.

Submit
Please wait...
About This Quiz
Data Structures And Algorithmic Concepts! Trivia Quiz - Quiz

Dive into the world of data structures with our 'Data Structures and Algorithmic Concepts! Trivia Quiz'. Test your knowledge on non-linear data structures, linked lists, stacks, binary trees,... see moreand array representations. Perfect for learners looking to sharpen their understanding and assess their skills in foundational computer science concepts. see less

2. Which of the following data structure is linear data structure?

Explanation

Arrays are a linear data structure because they store elements in a sequential manner, where each element has a unique index. This allows for efficient access and retrieval of elements, as they can be directly accessed using their index. Additionally, arrays have a fixed size, which means that elements are stored contiguously in memory. This linear arrangement of elements in memory allows for efficient traversal and manipulation of the array.

Submit
3. The Average case occur in linear search algorithm

Explanation

In linear search, the algorithm starts searching for the item from the beginning of the array and continues until it finds the item or reaches the end of the array. In the average case, the item being searched for is located somewhere in the middle of the array. This means that on average, the algorithm will have to search through half of the array before finding the item. Therefore, the average case occurs when the item is somewhere in the middle of the array.

Submit
4. Following sequence of operation is performed on a stack. Push(1), Push(2), Pop, Push(1), Push(2), Pop, Pop, Pop, Push(2), Pop. The sequences of popped out values are

Explanation

not-available-via-ai

Submit
5. In linked lists there are no NULL links in

Explanation

Circular linked lists do not have NULL links because the last node in the list points back to the first node, creating a circular structure. This means that there is no end or beginning of the list, and every node is connected to another node, forming a loop. Therefore, there are no NULL links in a circular linked list.

Submit
6. A queue has configuration a,b,c,d. To get configuration d,c,b,a. One needs a minimum of 

Explanation

To get from configuration a,b,c,d to configuration d,c,b,a, we need to perform the following steps:
1. Delete configuration a.
2. Delete configuration b.
3. Delete configuration c.
4. Add configuration d.
5. Add configuration c.
6. Add configuration b.
Therefore, we need a minimum of 3 deletions and 3 additions.

Submit
7. What is Non-linear data structure

Explanation

A tree is a non-linear data structure that organizes data in a hierarchical structure. It consists of nodes connected by edges, where each node can have multiple children but only one parent (except for the root node). This allows for efficient searching, insertion, and deletion operations. Trees are commonly used to represent hierarchical relationships, such as file systems, organization charts, or family trees. Unlike linear data structures like arrays, linked lists, or stacks, trees do not have a linear sequence and can have multiple branches and levels.

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

Explanation

The elements of an array are stored successively in memory cells because by this way the computer can keep track only the address of the first element and the addresses of other elements can be calculated. This allows for efficient memory management and easy access to array elements using index calculations based on the address of the first element.

Submit
9. How many types of queue's are available

Explanation

There are four types of queues available. The question is asking about the number of types, and the answer is given as 4. This means that there are four different categories or classifications of queues that exist.

Submit
10. With every push in the stack the   top

Explanation

The given answer states that with every push in the stack, the top increments by one. This means that whenever a new element is added to the stack, the top position is updated to point to the newly added element. This is a common behavior in stack data structures, where the top position keeps track of the most recently added element.

Submit
11. The total number of comparisons in a bubble sort is

Explanation

The bubble sort algorithm compares adjacent elements in a list and swaps them if they are in the wrong order. This process is repeated until the entire list is sorted. In the worst-case scenario, where the list is in reverse order, the algorithm needs to make n-1 passes through the list, each time comparing and swapping adjacent elements. Since each pass requires n-1 comparisons, the total number of comparisons in a bubble sort is O(n^2).

Submit
12. Number of possible ordered trees with 3 nodes A,B,C is

Explanation

The number of possible ordered trees with 3 nodes A, B, and C can be determined by considering all the possible arrangements of the nodes. In this case, there are 3 nodes, so there are 3 possible choices for the root node. Once the root node is chosen, there are 2 remaining nodes that can be arranged as the left and right children of the root. Therefore, the total number of possible ordered trees is 3 * 2 = 6.

Submit
13. Which of the following case does not exist in complexity theory

Explanation

The null case does not exist in complexity theory. In complexity theory, we analyze the performance of algorithms based on different input scenarios. The best case represents the scenario where the algorithm performs optimally, while the worst case represents the scenario where the algorithm performs the worst. The average case represents the scenario where the algorithm performs on average. However, there is no concept of a null case in complexity theory, as it does not provide any meaningful input scenario to analyze the algorithm's performance.

Submit
14. An algorithm consists of two modules X1, X2. Their order is f(n) and g(n), respectively. The order of algorithm is

Explanation

The order of an algorithm is determined by the module that takes the longest time to execute. In this case, the algorithm consists of two modules, X1 and X2, with orders f(n) and g(n) respectively. The order of the algorithm would be the maximum of f(n) and g(n) because the algorithm's overall efficiency is determined by the slowest module. Therefore, the correct answer is "Max(f(n),g(n))".

Submit
15. A leaf node have degree

Explanation

A leaf node is a node in a tree data structure that does not have any child nodes. The degree of a node is defined as the number of child nodes it has. Since a leaf node does not have any child nodes, its degree is 0.

Submit
16. Disadvantage of linear queue is overcome by using

Explanation

A disadvantage of a linear queue is that once the queue is full, it cannot accommodate any more elements, even if there are empty spaces at the front of the queue. This limitation is overcome by using a circular queue. In a circular queue, when the queue is full, the rear pointer wraps around to the front of the queue, allowing new elements to be added in the empty spaces at the front. This ensures efficient utilization of the available space in the queue and avoids wastage. Therefore, a circular queue is a suitable solution to overcome the disadvantage of a linear queue.

Submit
17. Finding the location of the element with a given value is:

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 element. This process typically involves comparing the given value with the values in the data structure until a match is found or the entire structure has been traversed. Therefore, "Search" is the most appropriate term to describe this operation.

Submit
18. In a balance binary tree the height of two sub trees of every node can not differ by more than

Explanation

In a balanced binary tree, the height of two subtrees of every node can differ by at most 1. This means that the absolute difference between the heights of the left and right subtrees of any node is either 0 or 1. If the difference is 2 or more, then the tree is considered unbalanced. Therefore, the correct answer is 1.

Submit
19. Arrays are best data structures

Explanation

Arrays are best data structures for relatively permanent collections of data because arrays have a fixed size and are efficient for accessing elements at specific indices. They provide constant time access to elements, making them suitable for situations where the size of the structure and the data in the structure are not constantly changing. Additionally, arrays are contiguous blocks of memory, allowing for efficient memory allocation and deallocation. Therefore, arrays are ideal for situations where the data collection is relatively permanent and does not require frequent resizing or modification.

Submit
20. Arrays are best data structures

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 are suitable for situations where the size of the structure and the data in the structure are not constantly changing. Arrays provide fast and direct access to elements, making them ideal for storing data that needs to be accessed frequently. However, arrays are not suitable for situations where the size of the structure and the data are constantly changing, as resizing an array can be inefficient.

Submit
21. Linked lists are best suited

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. Unlike arrays, which have a fixed size, linked lists can easily accommodate changes in size without the need for resizing or shifting elements. Therefore, linked lists are a flexible data structure for managing dynamic collections of data.

Submit
22. Linked lists are best suited

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. Unlike arrays, which have a fixed size, linked lists can dynamically adjust their size as needed, making them more flexible for handling changing data. Therefore, linked lists are particularly useful in scenarios where the size and content of the data need to be frequently modified.

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

Explanation

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. This allows for efficient memory management as the computer only needs to store the starting address of the array and can easily calculate the addresses of the other elements based on their indices.

Submit
24. In array representation of binary tree the right child of root will be at location of

Explanation

In an array representation of a binary tree, the right child of the root will be at location 2. This is because the array is usually indexed starting from 0, and in a binary tree, the left child is typically stored at index 2*i+1 and the right child at index 2*i+2, where i is the index of the parent node. In this case, the root is at index 0, so the right child will be at index 2*0+2 = 2.

Submit
25. Two main measures for the efficiency of an algorithm are

Explanation

The efficiency of an algorithm is measured by two main factors: time and space. Time refers to the amount of time it takes for the algorithm to execute and complete its task, while space refers to the amount of memory or storage space required by the algorithm to store and process data. Therefore, time and space are the correct measures for evaluating the efficiency of an algorithm.

Submit
26. To arrange a binary search tree in ascending order we need 

Explanation

In order to arrange a binary search tree in ascending order, we need to perform an inorder traversal. In inorder traversal, we visit the left subtree first, then the root, and finally the right subtree. This ensures that we visit the nodes in ascending order, as the left subtree contains smaller values, the root contains the current value, and the right subtree contains larger values. Therefore, inorder traversal is the correct choice for arranging a binary search tree in ascending order.

Submit
27. The value of structure is resizing during run time by using

Explanation

realloc is used to resize the memory allocated for a structure during runtime. It allows us to change the size of the structure by reallocating memory for it. This function takes two arguments - a pointer to the previously allocated memory and the new size of the structure. It then reallocates memory for the structure with the new size, copying the contents from the old memory to the new memory if necessary. realloc is useful when we need to dynamically resize a structure based on the requirements of the program.

Submit
28. The Worst case occur in linear search algorithm when

Explanation

In the worst case scenario for a linear search algorithm, the item being searched for is either the last element in the array or it is not present in the array at all. This means that in both cases, the algorithm will have to iterate through the entire array before determining that the item is either the last element or not present. This results in the worst possible time complexity for the linear search algorithm.

Submit
29. Under which condition circular queue is Full

Explanation

The circular queue is considered full when the front pointer is equal to the value of (rear+1)%maxsize. This condition indicates that the next position after the rear pointer is the same as the front pointer, which means that there are no more empty spaces in the queue to add new elements.

Submit
30. A Stack follows the principle of

Explanation

A stack follows the principle of LIFO, which stands for Last In, First Out. This means that the last item added to the stack is the first one to be removed. In a stack, new elements are added to the top and removed from the top. This behavior is similar to a stack of plates, where you can only remove the top plate and add new plates on top. Therefore, the correct answer is LIFO.

Submit
31. The Worst case occur in linear search algorithm when

Explanation

The worst case for a linear search algorithm occurs when the item being searched for is the last element in the array or is not present in the array at all. In the first scenario, the algorithm would need to iterate through the entire array before finding the item. In the second scenario, the algorithm would also need to iterate through the entire array without finding the item. In both cases, the algorithm would have to perform the maximum number of iterations, resulting in the worst case scenario.

Submit
32. Which of the following data structure is not linear data structure?

Explanation

The correct answer is "None of above" because both arrays and linked lists are examples of linear data structures. A linear data structure is a data structure where the elements are arranged in a sequential manner, and both arrays and linked lists meet this criteria. Therefore, none of the given options are not linear data structures.

Submit
33. What is the advantage of linear search

Explanation

The advantage of linear search is that it does not require the array to be sorted. This means that it can be used on any type of array, regardless of its order. This is beneficial because it allows for flexibility in searching for a specific element in the array, without the need to spend time sorting the array beforehand.

Submit
34. To Delete an item from a Queue identify the correct set of statements :-

Explanation

This set of statements correctly identifies the process of deleting an item from a queue. The first statement assigns the value of the item to be deleted to the variable Q[REAR]. Then, the second statement increments the value of REAR to indicate that the item has been removed from the queue. Finally, the third statement assigns the value of the item to the variable Q[FRONT] and increments the value of FRONT to indicate that the front of the queue has moved forward. This sequence of steps ensures that the item is properly deleted from the queue.

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

Explanation

Traversal refers to the process of visiting each element in a list or data structure, typically in a sequential manner. It involves accessing and examining each element one by one, without any specific order or arrangement. Traversal is commonly used in various algorithms and operations, such as searching, printing, or performing calculations on each element of a list. Therefore, the operation of processing each element in a list is known as traversal.

Submit
36. The result of evaluating prefix expression */b+*dacd, where a=3, b=6, c=1, d=5 is

Explanation

The given prefix expression */b+*dacd can be evaluated as follows:
1. *da = 3 * 5 = 15
2. +15c = 15 + 1 = 16
3. *b16 = 6 * 16 = 96
So, the result of evaluating the prefix expression is 96.

Submit
37. Which data structure is best suited to print the documents in the printer

Explanation

Queues are the best data structure suited for printing documents in a printer. This is because queues follow the First-In-First-Out (FIFO) principle, which means that the document that arrives first will be printed first. This ensures that the documents are printed in the order they were sent to the printer, maintaining the fairness and sequence of printing. Stacks, on the other hand, follow the Last-In-First-Out (LIFO) principle, which is not suitable for printing documents in the desired order. Arrays and None are not specifically designed for managing the order of documents in a printer.

Submit
38. The space factor when determining the efficiency of algorithm is measured by

Explanation

The space factor when determining the efficiency of an algorithm is measured by counting the maximum memory needed by the algorithm. This means that the efficiency of the algorithm is evaluated based on the maximum amount of memory it requires to execute. This measurement helps in understanding the algorithm's impact on memory usage and can be useful in optimizing the algorithm or determining the hardware requirements for running it efficiently.

Submit
39. The complexity of Bubble sort algorithm is

Explanation

Bubble sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The time complexity of bubble sort is O(n^2), where n is the number of elements to be sorted. This is because in the worst case scenario, where the list is in reverse order, bubble sort needs to make n-1 passes through the list, comparing and swapping elements each time. Therefore, the complexity of bubble sort is quadratic, making it inefficient for large lists.

Submit
40. Which Data structure is best suited for the UNDO operation in Windows

Explanation

The UNDO operation in Windows requires a data structure that follows the Last-In-First-Out (LIFO) principle, where the most recent action is undone first. A stack is the best-suited data structure for this operation as it allows for efficient insertion and deletion of elements at one end. When an action is performed, it is pushed onto the stack, and when the UNDO operation is triggered, the most recent action can be popped off the stack and reverted. Therefore, a stack is the correct choice for the UNDO operation in Windows.

Submit
41. Find the value of the postfix expression :- ABCD ^*-  (IF A = 150, B=10, C=2 D=3)

Explanation

The given postfix expression ABCD ^*-  can be evaluated as follows:
1. A ^ B = 150 ^ 10 = 1500
2. 1500 * C = 1500 * 2 = 3000
3. 3000 - D = 3000 - 3 = 2997
So, the value of the postfix expression is 2997. Therefore, the correct answer is not available.

Submit
42. The complexity of linear search algorithm is

Explanation

The complexity of a linear search algorithm is O(n) because it has to iterate through each element in the list or array until it finds the desired value. In the worst-case scenario, the desired value may be at the end of the list, requiring the algorithm to iterate through all n elements. Therefore, the time complexity of a linear search algorithm is directly proportional to the size of the input.

Submit
43. Average successful search time taken by binary search on sorted array of 10 items is

Explanation

The average successful search time taken by binary search on a sorted array of 10 items is 2.9. This means that, on average, it takes 2.9 units of time to find a specific element in the array using binary search. Binary search is an efficient search algorithm that works by repeatedly dividing the search interval in half, narrowing down the search space until the desired element is found. The average search time is influenced by factors such as the size of the array and the distribution of the elements within it.

Submit
44. In evaluating arithmatic expression 2*3-(4+5) using postfix stack form. Which of the following stack configuration is not possible

Explanation

The given stack configuration is not possible because in postfix form, the operators are placed after the operands. So, the correct stack configuration for the given arithmetic expression would be:

------Top--| 5 | 4 | 6 |------------

Submit
45. Which is not application of stack

Explanation

The given question asks for an application that is not related to a stack. The options provided are "Reversal of string," "evaluation of arithmetic operation," "Real operating system," and "Recursion." The correct answer is "Real operating system" because it is not an application that typically involves the use of a stack. Stacks are commonly used in tasks such as reversing a string, evaluating arithmetic operations, and implementing recursion. However, a real operating system is not directly associated with stack operations.

Submit
46. The time factor when determining the efficiency of algorithm is measured by

Explanation

The efficiency of an algorithm is determined by measuring the time it takes to execute. This can be done by counting the number of key operations, which are the fundamental steps performed by the algorithm. Counting microseconds is not a reliable measure as it can vary depending on the hardware and other factors. Counting the number of statements or kilobytes of algorithm does not directly relate to the time it takes to execute the algorithm. Therefore, counting the number of key operations is the most appropriate way to measure the time factor when determining the efficiency of an algorithm.

Submit
47.
The information about an array used in a program will be stored in

Explanation

A dope vector is a data structure used to store information about an array in a program. It contains details such as the size of the array, the starting address of the array, and other relevant information. The dope vector is typically used by the compiler or runtime system to perform operations on the array, such as bounds checking or memory allocation. Therefore, the information about an array used in a program will be stored in a dope vector.

Submit
48. What is the disadvantage of a binary search

Explanation

The disadvantage of a binary search is that it requires the array to be sorted. This means that if the array is not already sorted, it will need to be sorted first before the binary search can be performed. This additional sorting step can be time-consuming and may increase the overall time complexity of the search algorithm.

Submit
49. Hash function f is defined as f(key) = key mod 7. If linear probing is used to insert the key 37, 38, 72, 48, 98, 11, 56 into a table indexed from 0 to 6,  11 will be stored at the location

Explanation

The hash function f(key) = key mod 7 will give the remainder when the key is divided by 7. Using linear probing, if a collision occurs, the next available slot in the table will be checked.

When inserting the keys 37, 38, 72, 48, 98, 11, 56, the hash values will be as follows:
- f(37) = 37 mod 7 = 2
- f(38) = 38 mod 7 = 3
- f(72) = 72 mod 7 = 2 (collision with key 37, so next available slot 3 is checked)
- f(48) = 48 mod 7 = 6
- f(98) = 98 mod 7 = 0
- f(11) = 11 mod 7 = 4 (collision with key 48, so next available slot 5 is checked)
- f(56) = 56 mod 7 = 0 (collision with key 98, so next available slot 1 is checked)

Therefore, key 11 will be stored at location 5.

Submit
50. A binary tree in which every non-leaf node has non-empty left and right sub trees is called a strictly binary tree. Such a tree with 10 leaves

Explanation

A strictly binary tree is a binary tree where every non-leaf node has both a non-empty left and right subtree. In this case, the tree has 10 leaves, which means there are 10 nodes that do not have any children. Since every non-leaf node has two children, there must be 10 + 9 = 19 nodes in total. Therefore, the correct answer is that the tree has 19 nodes.

Submit
51. Four algorithm A1, A2, A3, A4 solves a problem with order log(n), log log(n), nlog(n), n. Which is best algorithm

Explanation

Algorithm A1 is the best algorithm because it has the lowest time complexity of O(log(n)). This means that as the input size increases, the running time of A1 grows at a slower rate compared to the other algorithms. A2 has a time complexity of O(log log(n)), A3 has a time complexity of O(n log(n)), and A4 has a time complexity of O(n). Therefore, A1 is the most efficient algorithm for solving the given problem.

Submit
52. Which one is the Application of Stack

Explanation

The correct answer is "All of the Above" because all the given options are valid applications of a stack. Polished notations involve using a stack to convert expressions from infix to postfix or prefix. Storing return addresses of function calls is a common use of a stack in programming languages. Reversing a string can be done by pushing each character onto a stack and then popping them in reverse order. Recursion often uses a stack to keep track of function calls and their return addresses. Therefore, all the given options are examples of how a stack can be applied.

Submit
53. Write the postfix notation of A + B * C / D

Explanation

The given expression A + B * C / D can be converted to postfix notation by following the rules of postfix notation. First, we multiply B and C, then divide the result by D, and finally add the result to A. Therefore, the correct postfix notation for the given expression is ABC*D/+.

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

Explanation

When declaring an array, it is not necessary to specify the first data from the set to be stored. The declaration only needs to include the name of the array and the data type of the array. The first data to be stored in the array is determined when the array is initialized or when values are assigned to specific indices of the array.

Submit
55. To arrange the books of library the best method is

Explanation

Heap sort is the best method to arrange the books in a library because it is an efficient sorting algorithm that guarantees a worst-case time complexity of O(n log n). Heap sort works by creating a binary heap data structure and repeatedly extracting the maximum element from it, resulting in a sorted list. This sorting algorithm is particularly useful for large datasets and has good performance characteristics in terms of both time and space complexity.

Submit
56. In a stack the command to access nth element from the top of the stack S will be

Explanation

To access the nth element from the top of the stack S, the correct command would be S [Top-n]. This means that starting from the top of the stack, we count n elements downwards to access the desired element. The other options, S [Top+n] and S [Top-n-1], do not accurately represent the correct command for accessing the nth element from the top of the stack.

Submit
57. Identify the UnderFlow condition for a Stack

Explanation

The correct answer is "if( top

Submit
58. A hash tabale with 10 buckets with one slot per bucket is depicted in following diagram. Symbols S1 to S7 are initially entered using a hashing function with linear probing. Maximum number of comparisions needed in searching an item that is not present is  www.psexam.com

Explanation

not-available-via-ai

Submit
59. In which of the following cases linked list implementaion of sparse matrices consumes same memory as a normal array

Explanation

In a linked list implementation of a sparse matrix, memory consumption depends on the number of non-zero entries in the matrix. The linked list implementation only stores the non-zero elements and their corresponding row and column indices, which reduces memory usage compared to a normal array that would store all elements of the matrix. In this case, a 6 x 5 matrix with 8 non-zero entries would consume the same amount of memory as a normal array because both would require storage for 8 non-zero elements.

Submit
60. The order of binary search algorithm is

Explanation

The order of the binary search algorithm is log n. This is because in each step of the algorithm, the search space is divided in half, resulting in a logarithmic time complexity. As the size of the input increases, the number of steps required to find the target element increases at a much slower rate compared to linear or quadratic time complexity. Therefore, the binary search algorithm has a logarithmic time complexity of log n.

Submit
61. Arranging a pack of cards by picking one by one is an example of

Explanation

Arranging a pack of cards by picking one by one is an example of insertion sort. In insertion sort, each element is compared to the elements before it and inserted into its correct position in the sorted portion of the array. Similarly, when arranging a pack of cards, we compare each card to the cards before it and insert it into its correct position in the sequence. This process continues until all the cards are sorted.

Submit
62. Average successful search time for sequential search on 'n' item is 

Explanation

The average successful search time for sequential search on 'n' items is (n+1)/2. This is because in a sequential search, each item in the list is checked one by one until the desired item is found. On average, the desired item is expected to be found in the middle of the list, which is at position (n+1)/2. Therefore, the average successful search time is (n+1)/2.

Submit
63. Number of swapping, operations need to sort numbers 8, 22, 7, 9, 31, 19, 5, 13 in ascending order using bubble sort

Explanation

not-available-via-ai

Submit
64. Depth of a binary tree with n node is

Explanation

The correct answer is log (n +1) - 1. This is because the depth of a binary tree with n nodes can be calculated using the formula log (n +1) - 1. The logarithm function helps determine the number of levels in the binary tree by finding the exponent to which the base (in this case, 2) must be raised to get the number of nodes (n +1). Subtracting 1 from the result gives the depth of the tree.

Submit
65. The complexity of merge sort algorithm is

Explanation

Merge sort is a divide-and-conquer algorithm that divides the input array into two halves, recursively sorts them, and then merges the sorted halves. The time complexity of merge sort is O(n log n) because in each recursive call, the array is divided into two halves, which takes O(log n) time, and then the merging process takes O(n) time. Therefore, the overall time complexity is O(n log n).

Submit
66. The dummy header in linked list contain

Explanation

The dummy header in a linked list does not contain any of the options mentioned in the question. A dummy header is an empty node that is used as a placeholder at the beginning of the linked list. It helps simplify the implementation of certain operations, such as inserting or deleting nodes, by providing a consistent starting point. However, it does not contain any actual data or pointers to the first or last records of the actual data.

Submit
67. Running time T(n), where 'n' is input size of recursive algorithm is given as follows:
T(n) = c + T(n-1), if n>1,
T(n) = d if n<1. The order of algorithm is

Explanation

The given running time of the recursive algorithm is T(n) = c + T(n-1) if n > 1, T(n) = d if n

Submit
68. To Insert an item from a stack identify the correct set of statements :-

Explanation

These statements correctly show the process of inserting an item into a stack. The first statement increases the top pointer to point to the next available position in the stack. The second statement assigns the item to that position in the stack. Therefore, the correct answer is "top++; S[top] = Item;".

Submit
69. The complexity of Binary search algorithm is

Explanation

The correct answer is O(log ). The complexity of the Binary search algorithm is logarithmic because it halves the search space at each step. In each iteration, the algorithm compares the target value with the middle element of the sorted array and eliminates half of the remaining elements. This process continues until the target value is found or the search space is reduced to zero. As a result, the time complexity of the Binary search algorithm is logarithmic in the worst case, making it highly efficient for searching in large sorted arrays.

Submit
70. What is the contents of the array after the execution of the following program :-
int a[] = {10,30, 20, 10, 30, 40};
for(i=1;i<=6;i++)
 {
   for(j=i+1 ; j<= 6; j++)
   {
      if(a[i] == a[j])
      {
         a[j] = 0;
      }
}

Explanation

The given program compares each element of the array 'a' with all the elements that come after it. If a duplicate element is found, it is replaced with 0. The program starts with the first element and compares it with all the elements that come after it. Then, it moves on to the second element and compares it with the remaining elements, and so on. Based on this logic, the correct answer is 10,30, 20, 0, 0, 40.

Submit
71. On which principle does stack work?

Explanation

The stack works on the principle of FILO, which stands for "First In, Last Out". This means that the element that is inserted first into the stack will be the last one to be removed. In other words, the most recently added element will be the first one to be removed from the stack. This behavior is similar to a stack of plates, where you can only remove the top plate, which is the last one that was added. Therefore, the correct answer is FILO.

Submit
72. Bib O notation w.r.t algorithm signifies

Explanation

not-available-via-ai

Submit
73. While inserting an item in an array of integers which loop is right, where pos is the pos at which insertion is to be made(assume array starts from 1 and N is the max no. of items in the array.)

Explanation

The correct loop for inserting an item in an array of integers at a given position is "for(i=N; i>=pos;i--) { A[i+1] = A[i] }". This loop starts from the last element of the array and moves towards the position where the insertion is to be made. It shifts each element one position to the right, creating space for the new item to be inserted at the desired position.

Submit
74. Find the postfix expression of the following :- A OR B AND !C

Explanation

The given expression is "A OR B AND !C". To convert it into postfix notation, we need to follow the order of operations. First, we have the negation operator "!C". Then, we have the AND operator "B AND !C". Finally, we have the OR operator "A OR (B AND !C)". Therefore, the postfix expression is "ABC! AND OR".

Submit
75. Identify the OverFlow condition for a Queue

Explanation

The correct answer is if(REAR > N). This condition checks if the rear index of the queue is greater than the maximum size of the queue (N). If this condition is true, it means that the queue has reached its maximum capacity and cannot accept any more elements, resulting in an overflow condition.

Submit
76. The complexity of the average case of an algorithm is

Explanation

The complexity of the average case of an algorithm is much more complicated to analyze than that of the worst case. This is because the worst case represents the scenario where the algorithm takes the maximum amount of time or resources to complete, while the average case represents the expected performance of the algorithm on typical inputs. Analyzing the average case involves considering a wide range of possible inputs and their probabilities, which can be more complex and time-consuming compared to analyzing the worst case.

Submit
77. Write the prefix notation of A + B * C / D

Explanation

The given expression is A + B * C / D. In prefix notation, the operator is placed before the operands. So, the correct prefix notation for the expression is + / * B C D A.

Submit
78. To delete an item from an array which loop is correct, where p is the position of deletion( assume array starts from 1 and N is the max no. of items in the array.)

Explanation

The correct loop for deleting an item from an array at position p is "for(i=pos;i

Submit
79. The indirect change of the values of a variable in one module by another module is called

Explanation

The term "side effect" refers to the indirect change of the values of a variable in one module by another module. It implies that when one module modifies a variable, it can unintentionally affect the behavior or output of another module. This can lead to unexpected and undesirable consequences in the program. Therefore, "side effect" is the correct term to describe this situation.

Submit
80. If the search item lies in the upper half in case of binary search which is the correct set of statements.

Explanation

In binary search, when the search item lies in the upper half, we need to update the lower bound (bot) to be one position higher than the middle index (mid). This is because the search item is greater than the middle value, so we can eliminate the lower half of the array and continue searching in the upper half. Therefore, the correct statement is bot = mid - 1.

Submit
View My Results

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

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

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 26, 2013
    Quiz Created by
    Seelak123
Cancel
  • All
    All (80)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
An Array is what kind of data structure
Which of the following data structure is linear data structure?
The Average case occur in linear search algorithm
Following sequence of operation is performed on a stack. Push(1),...
In linked lists there are no NULL links in
A queue has configuration a,b,c,d. To get configuration d,c,b,a. One...
What is Non-linear data structure
The elements of an array are stored successively in memory cells...
How many types of queue's are available
With every push in the stack the   top
The total number of comparisons in a bubble sort is
Number of possible ordered trees with 3 nodes A,B,C is
Which of the following case does not exist in complexity theory
An algorithm consists of two modules X1, X2. Their order is f(n) and...
A leaf node have degree
Disadvantage of linear queue is overcome by using
Finding the location of the element with a given value is:
In a balance binary tree the height of two sub trees of every node can...
Arrays are best data structures
Arrays are best data structures
Linked lists are best suited
Linked lists are best suited
The elements of an array are stored successively in memory cells...
In array representation of binary tree the right child of root will be...
Two main measures for the efficiency of an algorithm are
To arrange a binary search tree in ascending order we need 
The value of structure is resizing during run time by using
The Worst case occur in linear search algorithm when
Under which condition circular queue is Full
A Stack follows the principle of
The Worst case occur in linear search algorithm when
Which of the following data structure is not linear data structure?
What is the advantage of linear search
To Delete an item from a Queue identify the correct set of statements...
The operation of processing each element in the list is known as
The result of evaluating prefix expression */b+*dacd, where a=3, b=6,...
Which data structure is best suited to print the documents in the...
The space factor when determining the efficiency of algorithm is...
The complexity of Bubble sort algorithm is
Which Data structure is best suited for the UNDO operation in Windows
Find the value of the postfix expression :- ABCD ^*-  (IF A =...
The complexity of linear search algorithm is
Average successful search time taken by binary search on sorted array...
In evaluating arithmatic expression 2*3-(4+5) using postfix stack...
Which is not application of stack
The time factor when determining the efficiency of algorithm is...
The information about an array used in a program will be stored in
What is the disadvantage of a binary search
Hash function f is defined as f(key) = key mod 7. If linear probing is...
A binary tree in which every non-leaf node has non-empty left and...
Four algorithm A1, A2, A3, A4 solves a problem with order log(n), log...
Which one is the Application of Stack
Write the postfix notation of A + B * C / D
Each array declaration need not give, implicitly or explicitly, the...
To arrange the books of library the best method is
In a stack the command to access nth element from the top of the stack...
Identify the UnderFlow condition for a Stack
A hash tabale with 10 buckets with one slot per bucket is depicted in...
In which of the following cases linked list implementaion of sparse...
The order of binary search algorithm is
Arranging a pack of cards by picking one by one is an example of
Average successful search time for sequential search on 'n' item...
Number of swapping, operations need to sort numbers 8, 22, 7, 9, 31,...
Depth of a binary tree with n node is
The complexity of merge sort algorithm is
The dummy header in linked list contain
Running time T(n), where 'n' is input size of recursive algorithm is...
To Insert an item from a stack identify the correct set of statements...
The complexity of Binary search algorithm is
What is the contents of the array after the execution of the...
On which principle does stack work?
Bib O notation w.r.t algorithm signifies
While inserting an item in an array of integers which loop is right,...
Find the postfix expression of the following :- A OR B AND !C
Identify the OverFlow condition for a Queue
The complexity of the average case of an algorithm is
Write the prefix notation of A + B * C / D
To delete an item from an array which loop is correct, where p is the...
The indirect change of the values of a variable in one module by...
If the search item lies in the upper half in case of binary search...
Alert!

Advertisement