Online Test On Data Structures

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 Maheshjangid
M
Maheshjangid
Community Contributor
Quizzes Created: 2 | Total Attempts: 655
| Attempts: 142 | Questions: 67
Please wait...
Question 1 / 67
0 %
0/100
Score 0/100
1. 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 based on their position. Unlike trees and graphs, which have a hierarchical or interconnected structure, arrays have a simple and straightforward organization. Therefore, arrays are the correct answer for a linear data structure.

Submit
Please wait...
About This Quiz
Online Test On Data Structures - Quiz

Attempt All of the following questions. Each question carry equal mark

Tell us your name to personalize your report, certificate & get on the leaderboard!
2. Which of the following case does not exist in complexity theory

Explanation

The null case does not exist in complexity theory because it represents the absence of any input or operation. In complexity theory, we analyze the performance of algorithms based on different inputs and their sizes. The best case, worst case, and average case are all scenarios that can occur and have an impact on the algorithm's complexity. However, the null case, where there is no input or operation to analyze, is not considered in complexity theory.

Submit
3. 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 at each recursion level, the array is divided into two halves, resulting in log n levels. And at each level, the merge operation takes O(n) time to merge the two sorted halves. Therefore, the overall time complexity of merge sort is O(n log n).

Submit
4. The Average case occur in linear search algorithm

Explanation

In the average case of a linear search algorithm, the item being searched for is assumed to be present in the array. However, the position of the item in the array is not known. Therefore, the algorithm needs to iterate through the array, comparing each element with the item being searched for until a match is found. In the case where the item is somewhere in the middle of the array, the algorithm would need to iterate through approximately half of the array before finding the item. This results in a time complexity of O(n/2), which is equivalent to O(n), where n is the size of the array.

Submit
5. The complexity of Bubble sort algorithm is

Explanation

Bubble sort algorithm has a time complexity of O(n2). This means that the time taken by the algorithm to sort an array of n elements is proportional to the square of the number of elements. In other words, as the number of elements increases, the time taken to sort them increases exponentially. This is because the algorithm compares each element with every other element in the array, resulting in a nested loop structure. Therefore, the correct answer is O(n2).

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

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, without any specific order or arrangement. In this case, the operation described is the act of processing each element in the list, which aligns with the concept of traversal. Sorting, merging, and inserting, on the other hand, involve specific operations to rearrange or modify the elements in a list, which is not the case here.

Submit
7. Linked lists are best suited

Explanation

Linked lists are best suited for situations where the size of the structure and the data within the structure are constantly changing. This is because linked lists allow for efficient insertion and deletion of elements, as they do not require shifting of elements like arrays do. Additionally, linked lists can easily accommodate changes in size, as they can dynamically allocate memory as needed. Therefore, linked lists provide a flexible and efficient solution for managing data that is constantly changing in size.

Submit
8. The complexity of linear search algorithm is

Explanation

The complexity of a linear search algorithm is O(n) because in the worst-case scenario, the algorithm needs to iterate through each element in the list until it finds the desired element or reaches the end of the list. Therefore, the time taken by the algorithm is directly proportional to the size of the input list, making it a linear time complexity.

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

Explanation

The efficiency of an algorithm is typically 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 that the algorithm requires to run. By considering both time and space, we can determine how efficiently an algorithm utilizes computational resources.

Submit
10. 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. Traversal refers to the process of visiting and accessing each element in a data structure, while sorting involves arranging elements in a specific order. Therefore, "Search" is the most appropriate term for this particular action of locating an element.

Submit
11. Arrays are best data structures

Explanation

Arrays are best data structures for relatively permanent collections of data because arrays provide efficient random access to elements. Once an array is created, its size cannot be changed, making it suitable for storing data that does not need to be frequently modified or resized. Arrays also have a fixed size, which allows for efficient memory allocation. Therefore, arrays are a good choice when the collection of data is not expected to change frequently and when random access to elements is required.

Submit
12. 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 both of these scenarios, the algorithm has to iterate through the entire array to determine that the item is either at the last position or not present. This results in the maximum number of comparisons and makes it the worst case for the linear search algorithm.

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

Explanation

The correct answer is "None of above". This means that both arrays and linked lists are linear data structures. Arrays store elements in contiguous memory locations, allowing for direct access to any element. Linked lists, on the other hand, consist of nodes that are connected through pointers, forming a linear sequence. Therefore, both arrays and linked lists are examples of linear data structures.

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

Explanation

When declaring an array, it is not necessary to provide the information about 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 from the set to be stored can be assigned later when the array is initialized or when individual elements of the array are assigned values.

Submit
15. 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 perform its tasks. By considering the maximum memory usage, we can assess the algorithm's performance in terms of space utilization and make informed decisions about its efficiency.

Submit
16. 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 means that the computer only needs to know the starting address of the array, and it can easily calculate the address of any other element by adding the appropriate offset to the starting address. This allows for efficient access and manipulation of array elements in memory.

Submit
17. 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 divides the search space in half with each comparison. This means that as the size of the input increases, the number of steps required to find the desired element increases at a much slower rate compared to linear or quadratic time complexities. Therefore, the time complexity of the Binary search algorithm is O(log ).

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

Explanation

The efficiency of an algorithm is determined by measuring the time factor, which is commonly done by counting the number of key operations. Key operations refer to the essential steps or operations performed by the algorithm that directly impact its execution time. By counting the number of key operations, we can get a rough estimate of the algorithm's efficiency and compare it with other algorithms.

Submit
19. 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 because the average case takes into account a wide range of inputs and their probabilities, making it more difficult to determine the exact time or space complexity. In contrast, the worst case analysis focuses on the input that would result in the maximum amount of time or space required, which is usually easier to identify and analyze. Therefore, analyzing the average case complexity requires more detailed calculations and considerations, making it more complex than analyzing the worst case complexity.

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

Explanation

In a circular linked list, there are no NULL links because the last node in the list points back to the first node, creating a circular structure. This means that every node has a valid link to another node, and there are no NULL pointers. In contrast, both single linked lists and linear doubly linked lists have NULL links at the end of the list to indicate the end of the structure.

Submit
21. 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 sub trees of every node cannot differ by more than 1. This means that the heights of the left and right sub trees of a node should differ by at most 1 level. This ensures that the tree remains balanced and allows for efficient searching and insertion operations. If the height difference is more than 1, the tree is considered unbalanced and may lead to performance issues. Therefore, the correct answer is 1.

Submit
22. 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 recursive algorithm has a running time equation T(n) = c + T(n-1), which means that the running time of the algorithm is constant (c) plus the running time of the algorithm with input size reduced by 1 (T(n-1)). This indicates that the algorithm has a linear time complexity, as it performs a constant amount of work for each input size. Therefore, the order of the algorithm is n.

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

Explanation

When the values of a variable in one module are changed indirectly by another module, it is referred to as a side effect. This term is commonly used in programming to describe the unintended consequences that can occur when one module modifies the state of another module. Side effects can sometimes lead to unexpected behavior and can make code harder to understand and maintain.

Submit
24. 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 maps each key to a value between 0 and 6. When linear probing is used, if a collision occurs, the next available slot is checked. In this case, the keys 37, 38, 72, 48, 98, 11, and 56 are being inserted. When the key 11 is inserted, it is hashed to the value 4. However, since that slot is already occupied by the key 48, linear probing is used to check the next slot, which is 5. Since slot 5 is available, the key 11 will be stored at location 5.

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

Explanation

In the given prefix expression, the operator '*' multiplies the values of 'b' and the result of the next operation. The operator '+' adds the values of '0' and 'd'. The operator '/' divides the result of the previous operation by the value of 'a'. Finally, the operator '+' adds the result of the previous operation to the value of 'c'. Substituting the given values, the expression becomes (6 * (0 + 5) / 3) + 1 = 10. Therefore, the result of evaluating the prefix expression is 10.

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

Explanation

The number of possible ordered trees with 3 nodes A, B, C can be calculated using the formula for the number of rooted trees. In this case, there are 3 nodes, so the formula is 3^(3-1) = 3^2 = 9. However, since the trees are ordered, we need to divide by the number of ways the nodes can be arranged, which is 3! (factorial). Therefore, the total number of possible ordered trees is 9 / 3! = 9 / 6 = 1.5. Since the number of trees must be a whole number, the correct answer is 6, which is the closest whole number to 1.5.

Submit
27. 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
28. Time complexity of an algorithm T(n), where n is the input size is given by T(n) = T (n-1) + 1/n, if n>1 otherwise T(n) = 1. The order of algorithm is

Explanation

The given algorithm has a recurrence relation T(n) = T(n-1) + 1/n, which means that for each input size n, the algorithm calls itself with an input size of n-1 and performs an additional operation of 1/n. This indicates that the algorithm has a linear relationship with the input size.

By solving the recurrence relation, we find that the time complexity of the algorithm is O(n^2). This means that the algorithm has a quadratic order, as the time taken by the algorithm grows quadratically with the input size.

Submit
29. If yyy, xxx and zzz are the elements of a binary binary tree, then in preorder traversal which node will be traverse first

Explanation

In a preorder traversal of a binary tree, the root node is always traversed first, followed by the left subtree and then the right subtree. Therefore, in the given options, "yyy" will be traversed first as it is mentioned before "xxx" and "zzz".

Submit
30. 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 move the elements in the queue in reverse order. This means we need to delete the elements in the original queue and add them to a new queue in the reverse order. Since there are 4 elements in the original queue, we need to perform 3 deletions (to remove a,b,c) and 3 additions (to add d,c,b) in order to achieve the desired configuration. Therefore, the correct answer is 3 deletions and 3 additions.

Submit
31. 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 defined as a binary tree where every non-leaf node has both left and right sub trees. In this case, the tree has 10 leaves. Since each non-leaf node has two sub trees, there will be 9 non-leaf nodes in total (10 leaves - 1 root node). Therefore, the total number of nodes in the tree will be 10 leaves + 9 non-leaf nodes = 19 nodes.

Submit
32. If the out degree of every node is exactly equal to M or 0 and the num ber of nodes at level K is Mk-1 [con sider root at level 1], then tree is called as 
 (i) Full m-ary try(ii) Com plete m-ary tree (iii)Positional m-ary tree

Explanation

A tree where the out degree of every node is exactly equal to M or 0 and the number of nodes at level K is Mk-1 is called a full m-ary tree. This is because in a full m-ary tree, each node has exactly M children or no children, and the number of nodes at each level follows the pattern of Mk-1. Additionally, this tree can also be called a complete m-ary tree because it satisfies the condition of a complete tree, where all levels except the last are completely filled and all nodes are as far left as possible. Therefore, the correct answer is both (i) and (ii).

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

Explanation

Inorder traversal is the correct answer because it visits the nodes of a binary tree in ascending order. In this traversal, the left subtree is visited first, then the root node, and finally the right subtree. By visiting the nodes in this order, we can arrange the elements of the binary tree in ascending order. Therefore, inorder traversal is the appropriate method to arrange a binary tree in ascending order.

Submit
34. Write the output of following program:
int a[ ] = {1,2,3,} *p;

Explanation

The program is attempting to assign a value to a pointer variable without initializing it. As a result, the pointer variable will contain a random or junk value.

Submit
35. Consider two sorted lists of size L1, L2. Number of comparisions needed in worst case my merge sort algorithm will be

Explanation

The merge sort algorithm works by recursively dividing the list into smaller sublists, sorting them, and then merging them back together. In the worst case scenario, the algorithm will need to compare every element in both lists before merging them. Since there are L1 elements in the first list and L2 elements in the second list, the total number of comparisons needed would be L1 + L2. However, we subtract 1 from the sum because the last element of the first list does not need to be compared with the first element of the second list during the merging process. Therefore, the correct answer is L1 + L2 - 1.

Submit
36. 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 can be explained by considering that in a sequential search, the algorithm starts searching from the beginning of the list and continues until it finds the desired item. On average, the item being searched for is likely to be found in the middle of the list. Therefore, the time it takes to find the item can be approximated as (n+1)/2.

Submit
37. Four altorithm 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 time taken by A1 to solve the problem will increase at a much slower rate compared to the other algorithms. A2 has a time complexity of O(log log(n)), which is slightly worse than A1. A3 has a time complexity of O(n log(n)), which is worse than both A1 and A2. A4 has a time complexity of O(n), which is the worst among all the algorithms. Therefore, A1 is the most efficient algorithm for solving the given problem.

Submit
38. A sorting technique which guarrantees that records with same primary key occurs in the sorted list as in the original unsorted list is said to be

Explanation

A sorting technique is considered stable if it preserves the relative order of records with the same primary key in the sorted list as they were in the original unsorted list. This means that if two records have the same primary key, the one that appeared first in the unsorted list will also appear first in the sorted list.

Submit
39. 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 because in insertion sort, each element is compared to the elements on its left and inserted at the correct position, similar to how cards are picked and inserted into their correct positions in a pack. This process continues until all the cards are arranged in the correct order.

Submit
40. The average number of comparisions performed by merge sort alrotithm in merging two sorted list of length 2 is

Explanation

Merge sort algorithm divides the list into two halves until each sublist has only one element. Then it merges the sublists by comparing and sorting them. In this case, we have two sorted lists of length 2, which means each list has two elements. To merge these two lists, a total of 8 comparisons will be performed. Therefore, the average number of comparisons performed by the merge sort algorithm in merging two sorted lists of length 2 is 8/3.

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

Explanation

The correct answer is O(n2). In a bubble sort, each element of the array is compared with its adjacent element and swapped if necessary. This process is repeated until the array is sorted. As there are n elements in the array and for each element, we need to compare it with n-1 other elements, the total number of comparisons in a bubble sort is n * (n-1), which simplifies to O(n2).

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

Explanation

The correct answer is log (n +1) - 1. The depth of a binary tree is the maximum number of edges from the root to a leaf node. In a binary tree with n nodes, the maximum number of edges is n-1. Taking the logarithm of n+1 and subtracting 1 gives the depth of the tree.

Submit
43. 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 will be the maximum of f(n) and g(n) because the module that takes the longest time will determine the overall time complexity of the algorithm. Therefore, the correct answer is Max(f(n),g(n)).

Submit
44. In array representation of binary tree teh 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 3. This is because the array starts indexing from 0, and the right child is typically located at 2 * index + 2. In this case, the root's index is 0, so the right child would be at 2 * 0 + 2, which is 2. Therefore, the correct answer is 3.

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

Explanation

The given answer, 13, represents the number of swapping operations needed to sort the given numbers using bubble sort. Bubble sort works by repeatedly swapping adjacent elements if they are in the wrong order. In this case, there are a total of 8 numbers to sort. Therefore, the number of swapping operations required would be 8 - 1 = 7. However, since the question asks for the number of swapping operations needed to sort the numbers in ascending order, we need to add 6 more swapping operations to bring the largest number, 31, to its correct position. Hence, the total number of swapping operations needed is 7 + 6 = 13.

Submit
46. 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 is reduced as it only stores the non-zero entries. The size of the matrix is determined by the number of rows and columns, and the size of each entry. In this case, a 6 x 5 matrix with 8 non-zero entries would consume the same memory as a normal array because both would require space for all 30 elements (6 rows x 5 columns) regardless of the number of non-zero entries.

Submit
47. The advantage of sparse matrix linked list representationn over dope vector method is, that the former is

Explanation

The advantage of sparse matrix linked list representation over the dope vector method is that it is completely dynamic. This means that the linked list representation can handle matrices of any size and shape, while the dope vector method requires pre-allocation of memory for all possible matrix elements, even if they are not used. The linked list representation only stores the non-zero elements of the matrix, resulting in more efficient memory usage. Additionally, the linked list representation allows for efficient insertion and deletion of elements, making it a flexible and dynamic approach for representing sparse matrices.

Submit
48. In above question average access time will be

Explanation

The correct answer is 140. This is because the average access time is calculated by taking the sum of all access times and dividing it by the total number of access times. In this case, there are three access times given: 150, 140, and 55. Adding them together gives a sum of 345. Dividing this by the total number of access times (3) gives an average of 115. Therefore, the correct answer is 140.

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

Explanation

not-available-via-ai

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

Explanation

not-available-via-ai

Submit
51. 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, the correct command is S [Top-n]. This command indicates that we start from the top of the stack (Top) and move n positions downwards to access the desired element. The other options are incorrect because they either indicate moving upwards or do not account for the correct number of positions to move.

Submit
52. IThe dummy header in linked list contain

Explanation

The dummy header in a linked list contains the first record of the actual data. This dummy header is used to simplify operations on the linked list by providing a consistent starting point. It allows for easier insertion and deletion of nodes without having to handle special cases for an empty list. By pointing to the first record of the actual data, the dummy header ensures that the list always has a valid starting point for traversal and manipulation.

Submit
53. A text is made up of five characters, T1, T2, T3, T4, T5. The probability of occurance of each character is .12, .4, .15, .88 and .25, respectively. The optimal coding technique will have average length of 

Explanation

not-available-via-ai

Submit
54. If running time of an algorithm is given by T(n) = T(n-1) + T(n-2) + T(n-3), if n>3 otherwise T(n)=n, what should be relation between T(1), T(2), T(3) where algorithm order become constant

Explanation

The given relation T(1) - T(3) = T(2) suggests that the difference between the running time of the algorithm at n=1 and n=3 is equal to the running time at n=2. This implies that the algorithm order becomes constant when T(1), T(2), and T(3) are equal.

Submit
55. The centricity of node labeled 5 is


Explanation

The centricity of a node refers to the minimum eccentricity of that node, which is the maximum shortest path distance between that node and any other node in the graph. In this case, the node labeled 5 has a shortest path distance of 2 to itself, which is the minimum distance compared to the other nodes in the graph. Therefore, the centricity of node labeled 5 is 2.

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

Explanation

A dope vector is used to store information about an array used in a program. It contains details such as the starting address of the array, the size of the array, and other relevant information. This allows the program to access and manipulate the array efficiently. The symbol table is used to store information about variables and their corresponding memory locations, the register vector is used to keep track of the registers being used by the program, and the activation table is used to manage the activation records of function calls. However, none of these data structures specifically store information about arrays, making the dope vector the correct answer.

Submit
57. Running time of an algorithm T(n), where n is input size is given by T(n) = 8 T(n/2) + qn, if n>1 T(n) = p, if, n=1 where p and q are constants. The order of algorithm is

Explanation

The given algorithm has a recursive relation T(n) = 8 T(n/2) + qn, where n is the input size. This indicates that the algorithm divides the problem into two equal-sized subproblems and solves each subproblem recursively. The time complexity of solving each subproblem is T(n/2). Additionally, there is a linear term qn, which represents the time taken to combine the solutions of the subproblems.

By analyzing the recursive relation, we can observe that the algorithm has a complexity of O(n^3). This is because at each level of recursion, the problem size is divided by 2, resulting in a logarithmic factor of log(n) in the recursion tree. The qn term represents the work done at each level, which is linear in n. Combining these factors, we get a cubic time complexity of O(n^3).

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

Explanation

Heap sort is the best method to arrange the books in a library. Heap sort is an efficient sorting algorithm that works by creating a binary heap data structure. It has a time complexity of O(n log n) and is known for its optimal performance. By using heap sort, the books can be sorted in an organized and systematic manner, ensuring that they are easily accessible to library users.

Submit
59. Which of the following is correct

Explanation

External sorting is used when the number of items to be sorted is very large. This is because external sorting involves storing data on external storage devices, such as hard drives, rather than in main memory. External sorting is necessary when the data cannot fit entirely in memory, and it involves reading and writing data to and from the external storage during the sorting process. In contrast, internal sorting is used when the data can fit entirely in memory, and it involves sorting the data within the main memory.

Submit
60. On which principle does stack work?

Explanation

Stack works on the principle of FILO (First In Last Out). This means that the element which is inserted first into the stack will be the last one to be removed. When elements are added to the stack, they are placed on top of each other and when an element is removed, it is always the most recently added element. This behavior is similar to a stack of plates, where the last plate added is the first one to be removed. Therefore, the correct answer is FILO.

Submit
61. 6 files X1, X2, X3, X4, X5, X6 have 150, 250, 55, 85, 125, 175 number of records respectively. The order of storage ot optimize access time is

Explanation

The order of storage to optimize access time is X1, X2, X3, X4, X5, X6. This is because X1 has the highest number of records (150), followed by X2 (250), X3 (55), X4 (85), X5 (125), and X6 (175). By storing the files in this order, we can access the files with the highest number of records first, which will minimize the overall access time.

Submit
62. 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 the binary search algorithm. Binary search is an efficient algorithm for searching in sorted arrays, as it divides the search space in half at each step, reducing the number of elements to search by half each time. The average time complexity of binary search is logarithmic, which explains why the search time is relatively low for a small array size like 10.

Submit
63. The order of an algorithm that finds whether a given boolean function of 'n' variable produces a '1' is

Explanation

The order of an algorithm that finds whether a given boolean function of 'n' variable produces a '1' is exponential. This means that the time complexity of the algorithm grows exponentially with the input size 'n'. In other words, as 'n' increases, the time taken by the algorithm to determine the output becomes significantly larger. This suggests that the algorithm may not be efficient for large values of 'n' and could potentially take a very long time to compute the result.

Submit
64. 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

The given sequence of operations on a stack can be represented as follows:
- Push(1): The stack becomes [1]
- Push(2): The stack becomes [1, 2]
- Pop: The top element 2 is removed from the stack. The stack becomes [1]
- Push(1): The stack becomes [1, 1]
- Push(2): The stack becomes [1, 1, 2]
- Pop: The top element 2 is removed from the stack. The stack becomes [1, 1]
- Pop: The top element 1 is removed from the stack. The stack becomes [1]
- Pop: The top element 1 is removed from the stack. The stack becomes empty []
- Push(2): The stack becomes [2]
- Pop: The top element 2 is removed from the stack. The stack becomes empty []
Therefore, the sequence of popped out values is 2, 1, 2, 2, 2.

Submit
65. Which algorithm solves all pair shortest path problem

Explanation

Dijkstra's algorithm is used to solve the single-source shortest path problem, not the all pair shortest path problem. The correct algorithm to solve the all pair shortest path problem is Floyd's algorithm. This algorithm finds the shortest path between all pairs of vertices in a weighted graph. Prim's algorithm is used to find the minimum spanning tree of a graph, and Worshall's algorithm is used to find the transitive closure of a directed graph.

Submit
66. The order of binary search algorithm is

Explanation

The order of the binary search algorithm is n log n. This means that the time complexity of the algorithm is proportional to the logarithm of the input size (n) multiplied by the input size itself. This is because in each iteration of the binary search, the algorithm divides the search space in half, leading to a logarithmic time complexity. However, since the algorithm still needs to compare the elements in the search space, the overall time complexity is n log n.

Submit
67. Which of the following algorithm has n  log (n) time complexity

Explanation

Insertion sort has a time complexity of O(n log(n)). This is because it iterates through the array and for each element, it compares it to the previous elements and inserts it into the correct position. In the worst case scenario, where the array is sorted in descending order, each element would have to be compared to all the previous elements before it is inserted. This results in a time complexity of O(n^2). However, on average, the number of comparisons and shifts required is reduced, resulting in a time complexity of O(n log(n)).

Submit
View My Results

Quiz Review Timeline (Updated): Apr 16, 2024 +

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

  • Current Version
  • Apr 16, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 21, 2014
    Quiz Created by
    Maheshjangid
Cancel
  • All
    All (67)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Which of the following data structure is linear data structure?
Which of the following case does not exist in complexity theory
The complexity of merge sort algorithm is
The Average case occur in linear search algorithm
The complexity of Bubble sort algorithm is
The operation of processing each element in the list is known as
Linked lists are best suited
The complexity of linear search algorithm is
Two main measures for the efficiency of an algorithm are
Finding the location of the element with a given value is:
Arrays are best data structures
The Worst case occur in linear search algorithm when
Which of the following data structure is not linear data structure?
Each array declaration need not give, implicitly or explicitly, the...
The space factor when determining the efficiency of algorithm is...
The elements of an array are stored successively in memory cells...
The complexity of Binary search algorithm is
The time factor when determining the efficiency of algorithm is...
The complexity of the average case of an algorithm is
In linked lists there are no NULL links in
In a balance binary tree the height of two sub trees of every node can...
Running time T(n), where 'n' is input size of recursive algorithm is...
The indirect change of the values of a variable in one module by...
Hash function f is defined as f(key) = key mod 7. If linear probing is...
The result of evaluating prefix expression */b+0dacd, where a=3, b=6,...
Number of possible ordered trees with 3 nodes A,B,C is
A hash tabale with 10 buckets with one slot per bucket is depicted in...
Time complexity of an algorithm T(n), where n is the input size is...
If yyy, xxx and zzz are the elements of a binary binary tree, then in...
A queue has configuration a,b,c,d. To get configuration d,c,b,a. One...
A binary tree in which every non-leaf node has non-empty left and...
If the out degree of every node is exactly equal to M or 0 and the num...
To arrange a binary tree in ascending order we need 
Write the output of following program:int a[ ] = {1,2,3,} *p;
Consider two sorted lists of size L1, L2. Number of comparisions...
Average successful search time for sequential search on 'n' item...
Four altorithm A1, A2, A3, A4 solves a problem with order log(n), log...
A sorting technique which guarrantees that records with same primary...
Arranging a pack of cards by picking one by one is an example of
The average number of comparisions performed by merge sort alrotithm...
The total number of comparisons in a bubble sort is
Depth of a binary tree with n node is
An algorithm consists of two modules X1, X2. Their order is f(n) and...
In array representation of binary tree teh right child of root will be...
Number of swapping, operations need to sort numbers 8, 22, 7, 9, 31,...
In which of the following cases linked list implementaion of sparse...
The advantage of sparse matrix linked list representationn over dope...
In above question average access time will be
Bib O notation w.r.t algorithm signifies
In evaluating arithmatic expression 2*3-(4+5) using postfix stack...
In a stack the command to access nth element from the top of the stack...
IThe dummy header in linked list contain
A text is made up of five characters, T1, T2, T3, T4, T5. The...
If running time of an algorithm is given by T(n) = T(n-1) + T(n-2) +...
The centricity of node labeled 5 is
The information about an array used in a program will be stored in
Running time of an algorithm T(n), where n is input size is given by...
To arrange the books of library the best method is
Which of the following is correct
On which principle does stack work?
6 files X1, X2, X3, X4, X5, X6 have 150, 250, 55, 85, 125, 175 number...
Average successful search time taken by binary search on sorted array...
The order of an algorithm that finds whether a given boolean function...
Following sequence of operation is performed on a stack. Push(1),...
Which algorithm solves all pair shortest path problem
The order of binary search algorithm is
Which of the following algorithm has n  log (n) time complexity
Alert!

Advertisement