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
SettingsSettings
Please wait...
  • 1/80 Questions

    An Array is what kind of data structure

    • Linear
    • Non- Linear
    • Complex
    • All the above
    • None
Please wait...
About This 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, and array representations. Perfect for learners looking to sharpen their understanding and assess their skills in foundational computer science concepts.

Data Structures And Algorithmic Concepts! Trivia Quiz - Quiz

Quiz Preview

  • 2. 

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

    Rate this question:

  • 3. 

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

    Rate this question:

  • 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

    • 2,2,1,2,2

    • 2,2,1,1,2

    • 2,1,2,2,1

    • 2,1,2,2,2

    Correct Answer
    A. 2,2,1,1,2
  • 5. 

    In linked lists there are no NULL links in

    • Single linked list

    • Linear doubly linked list

    • Circular linked list

    • None of these

    Correct Answer
    A. Circular linked list
    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.

    Rate this question:

  • 6. 

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

    • 2 deletion and 3 additions

    • 3 deletions and 2 additions

    • 3 deletions and 3 additions

    • 3 deletions and 4 additions

    Correct Answer
    A. 3 deletions and 3 additions
    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.

    Rate this question:

  • 7. 

    What is Non-linear data structure

    • Tree

    • Stack

    • Linked-list

    • Array

    Correct Answer
    A. Tree
    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.

    Rate this question:

  • 8. 

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

    Rate this question:

  • 9. 

    How many types of queue's are available

    • 0

    • 1

    • 2

    • 4

    Correct Answer
    A. 4
    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.

    Rate this question:

  • 10. 

    With every push in the stack the   top

    • Decrements by one

    • Increments by one

    • Stays there itself

    • Its always a 0

    • None

    Correct Answer
    A. Increments by one
    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.

    Rate this question:

  • 11. 

    The total number of comparisons in a bubble sort is

    • O(n logn)

    • O(2n)

    • O(n2)

    • None of above

    Correct Answer
    A. O(n2)
    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).

    Rate this question:

  • 12. 

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

    • 16

    • 12

    • 6

    • 10

    Correct Answer
    A. 6
    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.

    Rate this question:

  • 13. 

    Which of the following case does not exist in complexity theory

    • Best case

    • Worst case

    • Average case

    • Null case

    Correct Answer
    A. Null case
    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.

    Rate this question:

  • 14. 

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

    • Max(f(n),g(n))

    • Min(f(n),g(n))

    • F(n)+g(n)

    • F(n)*g(n)

    Correct Answer
    A. Max(f(n),g(n))
    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))".

    Rate this question:

  • 15. 

    A leaf node have degree

    • 1

    • 2

    • 0

    • 3

    Correct Answer
    A. 0
    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.

    Rate this question:

  • 16. 

    Disadvantage of linear queue is overcome by using

    • Link list

    • Circular queue

    • Stack

    • Double ended queue

    Correct Answer
    A. Circular queue
    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.

    Rate this question:

  • 17. 

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

    Rate this question:

  • 18. 

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

    • 2

    • 1

    • 0

    • 3

    Correct Answer
    A. 1
    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.

    Rate this question:

  • 19. 

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

    Rate this question:

  • 20. 

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

    Rate this question:

  • 21. 

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

    Rate this question:

  • 22. 

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

    Rate this question:

  • 23. 

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

    Rate this question:

  • 24. 

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

    • 2

    • 5

    • 3

    • 0

    Correct Answer
    A. 2
    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.

    Rate this question:

  • 25. 

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

    Rate this question:

  • 26. 

    To arrange a binary search tree in ascending order we need 

    • Post order traversal

    • Inorder traversal

    • Preorder traversal

    • None of above

    Correct Answer
    A. Inorder traversal
    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.

    Rate this question:

  • 27. 

    The value of structure is resizing during run time by using

    • Malloc

    • Calloc

    • Free

    • Realloc

    Correct Answer
    A. Realloc
    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.

    Rate this question:

  • 28. 

    The Worst case occur in linear search algorithm when

    • Item is somewhere in the middle of the array

    • Item is not in the array at all

    • Item is the last element in the array

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

    Correct Answer
    A. Item is the last element in the array or is not there at all
    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.

    Rate this question:

  • 29. 

    Under which condition circular queue is Full

    • Front=-1

    • Front=(rear+1)%maxsize

    • Front=(front+1)%maxsize

    • Rear=(rear+1)%maxsize

    Correct Answer
    A. Front=(rear+1)%maxsize
    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.

    Rate this question:

  • 30. 

    A Stack follows the principle of

    • LIFO

    • FIFO

    • BOTH A and B

    • None

    Correct Answer
    A. LIFO
    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.

    Rate this question:

  • 31. 

    The Worst case occur in linear search algorithm when

    • Item is somewhere in the middle of the array

    • Item is not in the array at all

    • Item is the last element in the array

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

    Correct Answer
    A. Item is the last element in the array or is not there at all
    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.

    Rate this question:

  • 32. 

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

    Rate this question:

  • 33. 

    What is the advantage of linear search

    • Fast

    • Time consuming

    • Needs a sorted array

    • Does not needs a sorted array

    • ALL

    Correct Answer
    A. Does not needs a sorted array
    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.

    Rate this question:

  • 34. 

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

    • Q[REAR] = item; REAR ++;

    • Item = Q[FRONT]; FRONT++;

    • Item = Q[REAR]; FRONT ++;

    • Item = Q[FRONT]; REAR ++;

    • NONE

    Correct Answer
    A. Item = Q[FRONT]; FRONT++;
    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.

    Rate this question:

  • 35. 

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

    Rate this question:

  • 36. 

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

    • 0

    • 5

    • 10

    • 15

    Correct Answer
    A. 10
    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.

    Rate this question:

  • 37. 

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

    • Stacks

    • Queues

    • Both Stacks and Queues

    • Arrays

    • None

    Correct Answer
    A. Queues
    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.

    Rate this question:

  • 38. 

    The space factor when determining the efficiency of algorithm 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 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.

    Rate this question:

  • 39. 

    The complexity of Bubble sort algorithm is

    • O(n)

    • O(log n)

    • O(n2)

    • O(n log n)

    Correct Answer
    A. O(n2)
    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.

    Rate this question:

  • 40. 

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

    • Stack

    • Queues

    • Both Stack and Queues

    • Arrays

    • None

    Correct Answer
    A. Stack
    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.

    Rate this question:

  • 41. 

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

    • 70

    • 80

    • 150

    • 0

    • 1500

    Correct Answer
    A. 70
    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.

    Rate this question:

  • 42. 

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

    Rate this question:

  • 43. 

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

    • 2.6

    • 2.7

    • 2.8

    • 2.9

    Correct Answer
    A. 2.9
    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.

    Rate this question:

  • 44. 

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

    • -------Top--| 4 | 6 |------------

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

    • -------Top--| 9 | 6 |------------

    • ------Top--| 9 | 3 | 2 |------------

    Correct Answer
    A. ------Top--| 9 | 3 | 2 |------------
    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 |------------

    Rate this question:

  • 45. 

    Which is not application of stack

    • Reversal of string

    • Evaluation of arithimatic operation

    • Real operating system

    • Recursion

    Correct Answer
    A. Real operating system
    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.

    Rate this question:

  • 46. 

    The time factor when determining the efficiency of algorithm 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 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.

    Rate this question:

  • 47. 

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

    • Symbol table

    • Dope vector

    • Register vector

    • Activation table

    Correct Answer
    A. Dope vector
    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.

    Rate this question:

  • 48. 

    What is the disadvantage of a binary search

    • Fast

    • Time consuming

    • Needs a sorted array

    • Does not needs a sorted array

    • ALL

    Correct Answer
    A. Needs a sorted array
    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.

    Rate this question:

  • 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

    • 3

    • 4

    • 5

    • 6

    Correct Answer
    A. 5
    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.

    Rate this question:

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
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.