Computer Knowledge

Data Structures and Algorithms

1,256 Questions

Data Structures and Algorithms form the core of computer science, focusing on arrays, linked lists, trees, and sorting mechanisms. These concepts are essential for solving complex computational problems efficiently. Test takers preparing for technical and administrative IT exams will find these questions highly relevant.

Array OperationsLinked List ApplicationsSorting AlgorithmsTree Data StructuresMultilevel IndexingAlgorithm Time Complexity

Data Structures and Algorithms Questions

Multiple choice
  1. ordered list

  2. unordered list

  3. definition list

  4. nested list

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The dt (definition term) tag is used exclusively with definition lists (dl) to mark terms being defined. It pairs with dd (definition description) tags. Ordered and unordered lists use li tags, while dt is specific to definition list structures.

Multiple choice
  1. unordered list

  2. ordered list

  3. nested list

  4. definition list

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

A bulleted list is called an unordered list in HTML because the items don't need to appear in any specific sequence. It's created using the ul tag with li elements for each item.

Multiple choice
  1. push(@Countries, "Canada") will add new country "Canada" at the beginning of the array @Countries

    Now @Country gives @Countries = ("Canada", "India", "Denmark", "Russia", "Germany", "Japan", "Ireland")

  2. push(@Countries, "Canada") will add new country "Canada" at the end of the array @Countries

    Now @Countries gives @Countries = ("India", "Denmark", "Russia", "Germany", "Japan", "Ireland", "Canada")

  3. pop(@Countries, "India") will remove country "India" from the array @Countries

    Now @Countries looks like @Countries = ("Denmark", "Russia", "Germany", "Japan", "Ireland")

  4. pop(@Countries, "Ireland") will remove the country "Ireland" from the array @Countries

    Now @Countries looks like @Countries = ("India", "Denmark", "Russia", "Germany", "Japan")

  5. pop(@Countries) will remove the country "Ireland" last element of the array @Countries

    Now @Countries looks like @Countries = ("India", "Denmark", "Russia", "Germany", "Japan")

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Yes, Push function on array will add element at the end of the array Yes, pop function removes one element at the end of the array. It has only one argument, i.e., Array Name..

Multiple choice
  1. In a stack, data is stored from only one side. It is called 'top of stack'.

  2. At a time only one item can be inserted or deleted in a stack.

  3. In a stack, after insertion operation, the value of top is decremented.

  4. Stack is a linear data structure.

  5. Stack is called LIFO [last in first out].

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

It is not a true statement about a stack. Since in a stack after insertion operation, the value of top is incremented.

Multiple choice
  1. In a queue, data is inserted from the front end of the queue.

  2. In a queue after insertion and deletion operations, value of front end and rear end is incremented, respectively.

  3. Queue is called FIFO [First in first out].

  4. At a time, only one item can be inserted or deleted in a queue.

  5. Queue is a linear data structure.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This is a wrong answer. Since in a queue, data is inserted from the rear end of the queue and is deleted from the front end of the queue.