Data Structure Online Test

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 Infotricks1on1
I
Infotricks1on1
Community Contributor
Quizzes Created: 1 | Total Attempts: 4,780
| Attempts: 4,792
SettingsSettings
Please wait...
  • 1/164 Questions

    Array is Linear data  structure

    • True
    • False
Please wait...
About This Quiz

Total Questions-> 30Full Time-> 10 minutesNegative marking->0.15 for each question if answered wrongTotal Marks-> 30 (1 for each question)Before starting the test please fill out the form below as it will be needed to generate the Certificate.
<=50% -> Certificate will be provided

Data Structure Online Test - Quiz

Quiz Preview

  • 2. 

    Array is Linear data  structure

    • True

    • False

    Correct Answer
    A. True
    Explanation
    The given statement is true because an array is a linear data structure that stores elements of the same type in contiguous memory locations. It allows random access to its elements using an index, making it efficient for accessing and manipulating data. Arrays are widely used in programming to store and retrieve data efficiently.

    Rate this question:

  • 3. 

    Queue data structure works on

    • FIFO

    • LIFO

    • FILO

    • None of the above

    Correct Answer
    A. FIFO
    Explanation
    In queue, data item inserted first, will be available first and data item inserted last will be available in the last. FIFO stands for First In First Out and is a correct answer.

    Rate this question:

  • 4. 

    Which is not a primitive data type?

    • Stack

    • Int

    • Char

    • Float

    Correct Answer
    A. Stack
    Explanation
    The data types int, char, and float are all primitive data types in programming. They are built-in data types that are provided by the programming language itself. However, "Stack" is not a primitive data type. It is a data structure that can be implemented using primitive data types. A stack is a collection of elements that follows the Last-In-First-Out (LIFO) principle, and it can be implemented using arrays or linked lists. Therefore, "Stack" is the correct answer as it is not a primitive data type.

    Rate this question:

  • 5. 

    A queue is a,

    • FIFO (First In First Out) list.

    • LIFO (Last In First Out) list.

    • Ordered array.

    • Linear tree.

    Correct Answer
    A. FIFO (First In First Out) list.
    Explanation
    A queue is a data structure that follows the FIFO (First In First Out) principle, meaning that the element that is inserted first will be the first one to be removed. This is similar to a queue of people waiting in line, where the person who arrives first will be the first one to leave the line. Therefore, the correct answer is FIFO (First In First Out) list.

    Rate this question:

  • 6. 

    A queue is a,

    • FIFO (First In First Out) list.

    • LIFO (Last In First Out) list.

    • Ordered array.

    • Linear tree.

    Correct Answer
    A. FIFO (First In First Out) list.
    Explanation
    A queue operates on the principle of FIFO (First In First Out), meaning that the item that is added first is the one that will be removed first. This is similar to a line of people waiting for a service, where the person who arrived first will be served first. In a queue, new elements are added at the rear end and removed from the front end, maintaining the order in which they were added. Therefore, the correct answer is FIFO (First In First Out) list.

    Rate this question:

  • 7. 

    What is int stands for?

    Correct Answer
    integer
    Explanation
    The term "int" stands for "integer." In computer programming, an integer is a data type used to represent whole numbers without any fractional or decimal parts. The "int" keyword is commonly used in programming languages to declare variables that can store integer values. By using the "int" data type, programmers can perform mathematical operations and manipulate whole numbers in their code.

    Rate this question:

  • 8. 

    Which of the following data structure is linear data structure?  

    • Trees

    • Graphs

    • Arrays

    • None of above

    Correct Answer
    A. Arrays
    Explanation
    Arrays are linear data structures because they store elements in a sequential manner. Each element in an array is assigned a unique index, starting from 0, that represents its position in the array. This allows for efficient access to elements using their index. Additionally, arrays have a fixed size, meaning that elements are stored in contiguous memory locations, which enables efficient memory allocation and retrieval.

    Rate this question:

  • 9. 

    Which of the following data structure is linear data structure?  

    • Trees

    • Graphs

    • Arrays

    • None of above

    Correct Answer
    A. Arrays
    Explanation
    Arrays are linear data structures because they store elements in a sequential manner, where each element is accessed by its index. This means that elements are arranged one after another in a linear fashion. Unlike trees and graphs, which have a hierarchical or non-linear structure, arrays have a simple and straightforward organization. Therefore, the correct answer is Arrays.

    Rate this question:

  • 10. 

    For a binary search algorithm to work, it is necessary that the array (list) must be

    • Unsorted

    • Sorted

    • In a heap

    • Popped out of stack

    Correct Answer
    A. Sorted
    Explanation
    As binary search divides the list and selects a the sub-list to extend search based on comparison of values, it becomes necessary that the array (list) must be in sorted form.

    Rate this question:

  • 11. 

    Which is not primitive data structure

    • Stack

    • Int

    • Char

    • Float

    Correct Answer
    A. Stack
    Explanation
    The data types int, char, and float are all primitive data types in programming. They are built-in data types that are provided by the programming language. However, a stack is not a primitive data structure. It is an abstract data type that can be implemented using arrays or linked lists. Therefore, the correct answer is Stack.

    Rate this question:

  • 12. 

    What is the symbol of increment

    Correct Answer
    ++
    Explanation
    The symbol "++" is used to represent the increment operation in programming. It is commonly used to increase the value of a variable by 1. For example, if we have a variable x with an initial value of 5, using the "++" operator on x would result in x being incremented to 6. This symbol is widely recognized and used in various programming languages to perform increment operations.

    Rate this question:

  • 13. 

    A linear collection of data elements where the linear node is given by means of pointer is

    • Linked list

    • Node list

    • Primitive list

    • None of these

    Correct Answer
    A. Linked list
    Explanation
    A linked list is a linear collection of data elements where each element, also known as a node, is connected to the next element through a pointer. This allows for efficient insertion and deletion of elements at any position in the list. It is a dynamic data structure that can grow or shrink as needed. The other options, node list and primitive list, do not accurately describe a linked list.

    Rate this question:

  • 14. 

    Binary search tree is also called two way search tree

    • True

    • False

    Correct Answer
    A. True
    Explanation
    A binary search tree is a type of data structure where each node has at most two children, a left child and a right child. It is called a "binary" search tree because it follows a specific ordering property, where the value of each node is greater than all values in its left subtree and less than all values in its right subtree. This ordering property allows for efficient searching, insertion, and deletion operations. The term "two-way search tree" is another name for a binary search tree, emphasizing the ability to search in both directions, from the root to the leaves and vice versa. Therefore, the statement that a binary search tree is also called a two-way search tree is true.

    Rate this question:

  • 15. 

    Binary search tree is also called two way search tree

    • True

    • False

    Correct Answer
    A. True
    Explanation
    A binary search tree is a type of data structure where each node has at most two children, a left child and a right child. It is called a "two way search tree" because it allows for efficient searching in both directions. In a binary search tree, the left child of a node contains a smaller value than the node itself, while the right child contains a larger value. This property allows for quick searching by comparing the target value with the current node and traversing either left or right based on the comparison result. Hence, the statement "Binary search tree is also called two way search tree" is true.

    Rate this question:

  • 16. 

    A linear collection of data elements where the linear node is given by means of pointer is

    • Linked list

    • Node list

    • Primitive list

    • None of these

    Correct Answer
    A. Linked list
    Explanation
    A linked list is a linear collection of data elements where each element, called a node, contains a pointer that points to the next node in the list. This allows for efficient insertion and deletion of elements at any position in the list. Therefore, the correct answer is "linked list."

    Rate this question:

  • 17. 

    A multidimensional array is declared as such: int array[name1][name2];

    • True

    • False

    Correct Answer
    A. True
    Explanation
    A multidimensional array is declared by specifying the data type followed by the array name and the dimensions of the array enclosed in square brackets. In this case, the array is declared as "int array[name1][name2]", indicating that it is a multidimensional array with two dimensions named name1 and name2. Therefore, the given statement is true.

    Rate this question:

  • 18. 

    What is the symbol of decrement

    Correct Answer
    --
    Explanation
    The symbol "--" is commonly used to represent the decrement operation in programming languages. It is used to decrease the value of a variable by 1. For example, if we have a variable x with an initial value of 5, using the decrement operator "--" on x would result in x being equal to 4.

    Rate this question:

  • 19. 

    A subscript/index must be an integer or integer expression (using any integral type).

    • True

    • False

    Correct Answer
    A. True
    Explanation
    The statement is true because a subscript or index in programming is used to access elements in an array or collection, and it must be an integer or an expression that evaluates to an integer. This is because arrays are stored in memory as contiguous blocks, and the index is used to calculate the memory address of the desired element. Using a non-integer value or expression would not result in a valid memory address and would lead to an error.

    Rate this question:

  • 20. 

    Stack is work on the principal of

    • LILO

    • FIFO

    • FILO

    • LIFO

    Correct Answer
    A. LIFO
    Explanation
    The correct answer is LIFO, which stands for Last In, First Out. This means that the last element added to the stack will be the first one to be removed. In a stack, elements are added and removed from the top only, and the order in which they are added determines the order in which they are accessed. This concept is commonly used in programming and data structures, where the most recently added data is often the most relevant or needs to be processed first.

    Rate this question:

  • 21. 

    The position number is more formally called a subscript or index (this number specifies the number of elements from the beginning of the array).

    • True

    • False

    Correct Answer
    A. True
    Explanation
    The given statement is true. The position number in an array is indeed more formally called a subscript or index. This number represents the number of elements from the beginning of the array. It is used to access or reference specific elements within the array by indicating their position or index. Therefore, the correct answer is true.

    Rate this question:

  • 22. 

    In the statement:int a [ arraySize ] = { 87, 64, 52, 4, 45, 63, 55, 22, 78 };What is the element that is in the 7th index position?

    • 55

    • 22

    • 63

    • 78

    Correct Answer
    A. 22
    Explanation
    The element that is in the 7th index position in the given array is 22.

    Rate this question:

  • 23. 

    Which is the array name?int int1[ int2 ];

    • Int

    • Int1

    • Int2

    Correct Answer
    A. Int1
    Explanation
    The array name in the given code is "int1". It is declared as an array of integers with a size specified by the variable "int2". The name "int1" represents the memory location where the elements of the array are stored.

    Rate this question:

  • 24. 

    Static int array1[ arraySize];Will initialize each element to 0 the first time it is called.

    • True

    • False

    Correct Answer
    A. True
    Explanation
    The given statement is true. When an array is declared with the keyword "static" and without any explicit initialization, all the elements of the array will be automatically initialized to 0 the first time it is called. Therefore, in this case, each element of the array "array1" will be initialized to 0.

    Rate this question:

  • 25. 

    1.44 log n is the worst case height of an AVL tree.

    • True

    • False

    Correct Answer
    A. True
    Explanation
    An AVL tree is a self-balancing binary search tree where the heights of the left and right subtrees differ by at most 1. The worst-case height of an AVL tree is given by the formula 1.44 log n, where n is the number of nodes in the tree. This means that as the number of nodes increases, the height of the AVL tree grows logarithmically. Therefore, the statement "1.44 log n is the worst case height of an AVL tree" is true.

    Rate this question:

  • 26. 

    Stack is work on the principal of

    • LILO

    • FIFO

    • FILO

    • LIFO

    Correct Answer
    A. LIFO
    Explanation
    The correct answer is LIFO because a stack follows the Last-In-First-Out principle. This means that the last element added to the stack will be the first one to be removed. It is similar to a stack of plates, where the last plate added is the first one to be taken off when you remove them one by one. In programming, a stack is a data structure that allows operations like push (adding an element) and pop (removing an element) in a specific order, following the LIFO principle.

    Rate this question:

  • 27. 

    An algorithm that calls itself directly or indirectly is known as

    • Sub algorithm

    • Recursion

    • Polish notation

    • Traversal algorithm

    Correct Answer
    A. Recursion
    Explanation
    Recursion is the correct answer because an algorithm that calls itself directly or indirectly is known as recursion. In recursion, a function solves a problem by calling itself as a subroutine, which allows the problem to be broken down into smaller subproblems. This process continues until a base case is reached, at which point the function stops calling itself and returns the results. Recursion is commonly used in programming to solve problems that can be divided into smaller, similar subproblems.

    Rate this question:

  • 28. 

    ____________ are data structures consisting of related data items of the same type

    Correct Answer
    arrays
    Arrays
    Array
    Explanation
    Arrays are data structures that consist of related data items of the same type. They allow for efficient storage and retrieval of data by assigning a unique index to each data item. Arrays can store elements such as integers, strings, or objects, and the elements can be accessed by their index position. The given answer options "arrays," "Arrays," and "Array" all correctly describe arrays as data structures consisting of related data items of the same type.

    Rate this question:

  • 29. 

    The memory address of the first element of an array is called

    • Floor address

    • Foundation address

    • First address

    • Base address

    Correct Answer
    A. Base address
    Explanation
    The memory address of the first element of an array is called the base address. This is because the base address is the starting point or reference point for accessing the elements of the array. It is used to calculate the memory address of each subsequent element in the array by adding the appropriate offset.

    Rate this question:

  • 30. 

    [ ] and ( ) have the highest precedence

    • True

    • False

    Correct Answer
    A. True
    Explanation
    The statement is true because in most programming languages, square brackets [ ] and parentheses ( ) have the highest precedence. This means that any operations or expressions enclosed within these symbols will be evaluated first before any other operations. This is important for maintaining the correct order of operations in mathematical expressions or accessing elements in arrays or lists.

    Rate this question:

  • 31. 

    When passing an array to a function, the array size is normally passed as well, so the function can process the specific number of elements in the array.

    • True

    • False

    Correct Answer
    A. True
    Explanation
    When passing an array to a function, it is important to pass the array size as well. This is because the function needs to know the specific number of elements in the array in order to process it correctly. Without knowing the size, the function may not be able to access or manipulate the array elements accurately, leading to errors or unexpected behavior. Therefore, it is necessary to pass the array size along with the array itself when calling a function.

    Rate this question:

  • 32. 

    The value of the name of the array is the address in the computer’s memory of the first element of the array.Because the starting address of the array is passed, the called function knows precisely where the array is stored in memory.

    • True

    • False

    Correct Answer
    A. True
    Explanation
    The value of the name of the array being the address in the computer's memory of the first element of the array is true. This is because when an array is declared, it is stored in contiguous memory locations. The name of the array acts as a pointer to the first element, so when the array is passed to a function, the function can access and manipulate the array by using the starting address.

    Rate this question:

  • 33. 

     Which data structure allows deleting data elements from front and inserting at rear?

    • Stacks

    • Queues

    • Deques

    • Binary search tree

    Correct Answer
    A. Queues
    Explanation
    Queues are a data structure that allows deleting data elements from the front and inserting at the rear. In a queue, the first element that is inserted is the first one to be removed, following the First-In-First-Out (FIFO) principle. This makes queues suitable for scenarios where the order of insertion and removal is important, such as processing tasks or handling requests in a sequential manner. Stacks, on the other hand, follow the Last-In-First-Out (LIFO) principle, where the last element inserted is the first one to be removed. Deques (Double-ended queues) allow insertion and deletion from both ends, while binary search trees are used for efficient searching and sorting operations.

    Rate this question:

  • 34. 

    Pass by reference means that the calling function can read and write to the original values.

    • True

    • False

    Correct Answer
    A. True
    Explanation
    Pass by reference is a method in programming where a function can access and modify the original values of variables passed to it. This means that any changes made to the variables within the function will also affect the original values outside of the function. Therefore, the statement "Pass by reference means that the calling function can read and write to the original values" is true.

    Rate this question:

  • 35. 

    A multidimensional array is declared as such:int array[ [] ];

    • True

    • False

    Correct Answer
    A. False
    Explanation
    The given statement is false because when declaring a multidimensional array, the size of each dimension needs to be specified. In the given statement, the size of the array dimensions is not provided, which makes it invalid. The correct syntax for declaring a multidimensional array would be something like "int array[][]" or "int array[3][4]" where the size of each dimension is specified.

    Rate this question:

  • 36. 

    Which of the following is an array declaration with initalizers

    • Int n[ 10 ];

    • Int *n;

    • Int &n = 10;

    • Int n[10] = { 1, 2, 3, 4, 5 };

    Correct Answer
    A. Int n[10] = { 1, 2, 3, 4, 5 };
    Explanation
    The correct answer is "int n[10] = { 1, 2, 3, 4, 5 };" because it declares an array named "n" with a size of 10 and initializes it with the values 1, 2, 3, 4, and 5. This syntax is used to declare and initialize an array in a single line. The other options either declare an array without initializing it (int n[10];), declare a pointer (int *n;), or declare a reference (int &n = 10;) which is not valid syntax for array declaration with initializers.

    Rate this question:

  • 37. 

    Int n[11];What is the last index number (or subscript) of this array?

    • 11

    • 12

    • 9

    • 10

    • None of the above

    Correct Answer
    A. 10
    Explanation
    The last index number (or subscript) of the array "n" is 10. The array "n" has a total of 11 elements, numbered from index 0 to index 10. Therefore, the last index number is 10.

    Rate this question:

  • 38. 

    Applying 'static' to an array declaration will allow the array not to be created and initialized each time a program calls a function containing the array.

    • True

    • False

    Correct Answer
    A. True
    Explanation
    By applying the 'static' keyword to an array declaration, the array will not be created and initialized each time a program calls a function containing the array. This means that the array will retain its values between function calls, allowing for efficient memory usage and potentially improving performance. Therefore, the given statement is true.

    Rate this question:

  • 39. 

    Time complexity of linear search is

    • 0(n)

    • 0(1)

    • O(log n)

    • 0(n log n)

    Correct Answer
    A. 0(n)
    Explanation
    The time complexity of linear search is O(n) because in the worst case scenario, the algorithm needs to iterate through the entire list of n elements to find the desired element. This means that the time taken to execute the algorithm grows linearly with the size of the input.

    Rate this question:

  • 40. 

    C++ passes arrays to functions by reference—the called functions can modify the element values in the callers’ original arrays.

    • True

    • False

    Correct Answer
    A. True
    Explanation
    In C++, arrays are passed to functions by reference, which means that the called functions have access to the original arrays and can modify the values of their elements. Therefore, the statement that C++ passes arrays to functions by reference and allows modification of the original arrays is true.

    Rate this question:

  • 41. 

    The name of the array is the address in the computers memory of the first element of the array

    • True

    • False

    Correct Answer
    A. True
    Explanation
    The statement is true because in most programming languages, the name of an array represents the memory address of the first element of the array. This memory address is used to access and manipulate the elements of the array.

    Rate this question:

  • 42. 

    Which data structure is needed to convert infix notation to postfix notation?

    • Branch

    • Queue

    • Tree

    • Stack

    Correct Answer
    A. Stack
    Explanation
    To convert infix notation to postfix notation, a stack data structure is needed. In infix notation, operators are placed between operands, whereas in postfix notation, operators are placed after their operands. To convert infix to postfix, we scan the infix expression from left to right and use a stack to store operators. When we encounter an operator, we compare its precedence with the top of the stack. If the operator has higher precedence, we push it onto the stack. If the operator has lower precedence, we pop the operators from the stack and append them to the postfix expression until we find an operator with lower precedence or an opening parenthesis. This process continues until the entire infix expression is scanned.

    Rate this question:

  • 43. 

    Highest precedence is

    • *

    • -

    • +

    • ^

    Correct Answer
    A. ^
    Explanation
    The given answer is "^". In mathematical operations, the caret symbol (^) represents exponentiation, which has the highest precedence among the given operators. This means that any expression involving exponentiation should be evaluated first before any other operations like multiplication (*), subtraction (-), or addition (+). Therefore, the correct answer is "^" because it has the highest precedence.

    Rate this question:

  • 44. 

    Concept of array employes Wastage of memory 

    • True

    • False

    Correct Answer
    A. True
    Explanation
    The concept of array employees can lead to wastage of memory because arrays have a fixed size and if the number of employees is less than the size of the array, the remaining memory allocated for the array will be wasted. This can be inefficient in terms of memory utilization. Therefore, the statement "concept of array employees Wastage of memory" is true.

    Rate this question:

  • 45. 

    The situation when in a linked list START=NULL is

    • Underflow

    • Overflow

    • Housefull

    • saturated

    Correct Answer
    A. Underflow
    Explanation
    When the linked list's START pointer is NULL, it means that there are no nodes in the list. This situation is known as underflow. Underflow occurs when we try to access or retrieve data from an empty list. In this case, there is no data to retrieve, and hence it is considered an underflow condition.

    Rate this question:

  • 46. 

    A full binary tree with n leaves contains

    • N nodes.

    • Log n 2 nodes.

    • 2n –1 nodes.

    • n 2 nodes.

    Correct Answer
    A. 2n –1 nodes.
    Explanation
    A full binary tree is a binary tree in which every node has either 0 or 2 children. In a full binary tree with n leaves, each leaf node represents a unique element, and each internal node represents an operation or a function. Since each internal node has 2 children, the total number of nodes in the tree can be calculated as 2n - 1, where n is the number of leaves. Therefore, the correct answer is 2n – 1 nodes.

    Rate this question:

  • 47. 

    Overflow condition in stack is called

    • ADT Error

    • Stack implementation Error

    • Indifinite Error

    • Syntax Error

    Correct Answer
    A. Stack implementation Error
    Explanation
    Stack implementation error refers to a situation where there is an overflow condition in the stack. This means that the stack has reached its maximum capacity and cannot accept any more elements. This error occurs when attempting to push an element onto a full stack, causing the stack to overflow. Therefore, the correct answer for this question is "Stack implementation Error".

    Rate this question:

  • 48. 

    Overflow condition in stack is called

    • ADT Error

    • Stack implementation Error

    • Indifinite Error

    • Syntax Error

    Correct Answer
    A. Stack implementation Error
    Explanation
    Stack implementation error refers to a situation where the stack data structure is not implemented correctly, leading to an overflow condition. This means that the stack has reached its maximum capacity and cannot accept any more elements. It is a mistake in the way the stack is designed or implemented, rather than an error in the abstract data type (ADT) itself. This error can occur due to various reasons such as incorrect size allocation, improper handling of push and pop operations, or failure to check for overflow conditions.

    Rate this question:

  • 49. 

    AVL stands for

    • Any vital lenght

    • Height balanced tree

    • Another voilence laptord

    • Anti virtual lite

    Correct Answer
    A. Height balanced tree
    Explanation
    AVL stands for "Height balanced tree". This is a data structure that is used in computer science to efficiently store and retrieve data. In an AVL tree, the heights of the left and right subtrees of any node differ by at most one, ensuring that the tree remains balanced. This balance property allows for faster search, insertion, and deletion operations compared to other types of trees.

    Rate this question:

Quiz Review Timeline (Updated): Aug 10, 2024 +

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

  • Current Version
  • Aug 10, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • May 19, 2017
    Quiz Created by
    Infotricks1on1
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.