0

Data Structures and Algorithms

Description: DS
Number of Questions: 15
Created by:
Tags: DS Data Structures and Algorithms
Attempted 0/15 Correct 0 Score 0

Which of the following operations in one-dimensional array is the accessing of each element of the array exactly once to do some operation?

  1. Searching

  2. Traversing

  3. Sorting

  4. Insertion

  5. Deletion


Correct Option: B
Explanation:

This operation in one-dimensional array is the accessing of each element of the array exactly once to do some operation.

Which of the following operations on queue removes the front item from the queue and does not accept any arguments nor returns the item?

  1. Queue()

  2. enqueue(item)

  3. dequeue()

  4. isEmpty()

  5. size()


Correct Option: C
Explanation:

This operation on queue removes the front item from the queue.

Which of the following conditions indicates that the queue is full of items or overflow?

  1. FRONT=0, REAR=0

  2. REAR = REAR + 1

  3. FRONT = FRONT - 1

  4. REAR = MAX-1

  5. FRONT = -1


Correct Option: D
Explanation:

This condition indicates that the queue is full of items or overflow.

Which of the following operations in ordered lists is used to test whether a given object instance is in the container or not?

  1. Insert

  2. Withdraw

  3. Find

  4. isMember

  5. Exit


Correct Option: D
Explanation:

This operation is used to test whether a given object instance is in the container or not.

Which of the following components of Abstract Data give(s) the description on how to manipulate information in the storage structures to obtain the results defined for the operations?

  1. Operations

  2. Storage structures

  3. Algorithms

  4. Tuples

  5. Attributes


Correct Option: C
Explanation:

This component of Abstract Data gives the description on how to manipulate information in the storage structures to obtain the results defined for the operations.

Which of the following applications of stack is an expression in which an operator follows the two operands?

  1. Infix expression

  2. Postfix expression

  3. Prefix expression

  4. Arithmetic expression

  5. Relational expression


Correct Option: B
Explanation:

This application of stack is an expression in which an operator follows the two operands.

Which of the following types of data structure is the one in which each node points to the next node and also to the previous node?

  1. Singly linked list

  2. Circular list

  3. Doubly linked list

  4. Tree

  5. Array


Correct Option: C
Explanation:

This is the data structure in which each node points to the next node and also to the previous node.

Which of the following forms of binary tree is the one in which every non-leaf node has non-empty left and right subtrees?

  1. Complete binary tree

  2. Strictly binary tree

  3. Directed tree

  4. Binary tree

  5. Siblings


Correct Option: B
Explanation:

This form of binary tree is the one in which every non-leaf node has non-empty left and right subtrees.

Which of the following elements of a tree is a node which has both a parent and at least one child node?

  1. Root

  2. Leaf

  3. Non-leaf

  4. Parent

  5. Internal nodes


Correct Option: C
Explanation:

This element of a tree is a node which has both a parent and at least one child node.

Which of the following forms of sorting is applied when the entire collection of data to be sorted is small enough that the sorting can take place within main memory?

  1. Internal sorting

  2. External sorting

  3. Bubble sort

  4. Selection sort

  5. Insertion sort


Correct Option: A
Explanation:

This form of sorting is applied when the entire collection of data to be sorted is small enough that the sorting can take place within main memory.

In binary search algorithm, consider the case if(ele < a[Mid]). Which of the following conditions is applicable?

  1. High=Mid-1

  2. Low=Mid+1

  3. High=Mid+1

  4. High=Low-1

  5. Low=High


Correct Option: A
Explanation:

This is the correct condition as if element is lesser than a[Mid], then the required element is available in the first half of the list.

Consider an array of MxN order. Which of the following formulae gives the location of the element in Row-major ordering of elements?

  1. Loc(a[i][j]) = Base(a) + w[ (i-1) +N(j-1)]

  2. Loc(a[i][j]) = Base(a) + w[N(i-1) +(j-1)]

  3. Loc(a[i][j]) = Base(a) + w[M(i-1) +(j-1)]

  4. Loc(a[i][j]) = Base(a) + w[ M(i-1) +N(j-1)]

  5. Loc(a[i][j]) = Base(a) + w[ (i-1) +(j-1)]


Correct Option: B
Explanation:

This is the correct formula because it first computes the number of elements in the rows above the specified element, N(i - 1), and adds to it the number of elements in front of the specified element in the same row, (j - 1). w is word length. Base(a) is the address of first element.

Which of the following is searching a hash table extremely fast just to find the hash value for the item that you're looking for, then goes to that index and start searching the array until you find what you are looking for or you hit a blank spot?

  1. Linear search

  2. Binary search

  3. Hash search

  4. Interpolation search

  5. Recursive binary search


Correct Option: C
Explanation:

This type of search is searching a hash table extremely fast just to find the hash value for the item that you're looking for.

Which of the following is a data structure in which insertion and deletion takes place at both the ends?

  1. Simple queue

  2. Circular queue

  3. Priority queue

  4. Dequeue

  5. Stack


Correct Option: D
Explanation:

This is a queue in which insertion and deletion takes place at both the ends.

Which of the following terms in a tree data structure specifies the length of the longest downward path to a leaf from a particular node?

  1. Degree

  2. Height

  3. Depth

  4. Leaf node

  5. Graph


Correct Option: B
Explanation:

This term in a tree data structure specifies the length of the longest downward path to a leaf from a particular node.

- Hide questions