Computer Knowledge

Data Structures and Algorithms

1,518 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 technology web technology
  1. $index
  2. $iteration
  3. $count
  4. $ListCount
Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In webMethods Developer, when iterating through a list using a LOOP construct, the built-in variable that provides the current iteration index is $iteration. This variable automatically tracks the current position in the loop, starting from 0 or 1 depending on configuration. The other options ($index, $count, $ListCount) are not the standard loop index variables in webMethods.

Multiple choice technology databases
  1. distributes a row to single output and another to the other output

  2. distributes its input to one or more outputs

  3. join two inputs

  4. extract data from a connection

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

Multicast Transformation in SSIS takes a single input row and distributes it to multiple outputs simultaneously. Each output receives a copy of the same row, enabling parallel processing paths.

Multiple choice technology mainframe
  1. Serial Search on sorted table

  2. Binary Search on sorted table

  3. Serial Search on Non sorted table

  4. Binary Search on Non sorted table

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

SEARCH ALL in COBOL implements binary search, which requires the table to be sorted. Binary search repeatedly divides the search interval in half, making it much faster than serial search (option C), but only works on sorted data. Regular SEARCH uses serial search.

Multiple choice technology
  1. Removing the duplicates for the records which statisfies the where clause

  2. rows are only output down the link of the first Where clause they satisfy

  3. rows output down the links of all Where clauses that they satisfy.

  4. None of the above

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

The Output rows only once option ensures each row goes down only the first matching output link. Once a row satisfies a where clause, it's output and doesn't evaluate subsequent clauses. This prevents duplicate routing when rows match multiple filter conditions.

Multiple choice technology mainframe
  1. SEARCH - is a binarysearch. : SEARCH ALL - is serial search & the table must be sorted

  2. SEARCH - is a serial search : SEARCH ALL - is binary search & the table must be sorted

  3. Both are binary search

  4. SEARCH - is a binarysearch & the table is unsorted : SEARCH ALL - is serial search

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

SEARCH is a serial (linear) search that examines table elements sequentially. SEARCH ALL implements a binary search algorithm, which requires the table to be sorted in ascending or descending order. Binary search is much faster for large tables but has the sorting prerequisite.

Multiple choice technology platforms and products
  1. True

  2. False

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

In DataStage, when a sequential file stage encounters a null value and the NullFieldValue property is not assigned, the row gets rejected. If no reject link is attached to handle rejected rows, the job aborts with a fatal error. This behavior ensures data quality by stopping execution rather than writing incomplete or inconsistent data.

Multiple choice technology performance
  1. n

  2. n squared

  3. n log(n)

  4. e raised to n

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

Quicksort uses divide-and-conquer, recursively partitioning around a pivot element. Each level processes all n elements, and there are O(log n) levels on average (balanced partitions), giving n log(n) complexity. Best and average cases are n log(n), worst case (already sorted with poor pivot choice) degrades to n squared. Linear n and exponential e^n are incorrect.

Multiple choice technology programming languages
  1. Vector

  2. Hash table

  3. Linked list

  4. Enumeration

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

Hash tables index and store objects using key-value pairs where keys are hashed to determine storage location, enabling O(1) average lookup, insert, and delete operations. Vectors use sequential indexing, linked lists use node references, and enumerations provide sequential access without direct indexing. Only hash tables provide dictionary-style key-based object storage.

Multiple choice technology programming languages
  1. Vector

  2. Hash table

  3. Linked list

  4. Enumeration

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

A linked list is highly efficient for inserting or removing elements in the middle of a collection because it only requires updating node pointers. Arrays and Vectors require shifting subsequent elements, and hashtables map key-value pairs rather than ordered positions.

Multiple choice technology programming languages
  1. Vector

  2. Hash table

  3. Linked list

  4. Enumeration

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

Vector is a legacy collection class that implements a growable array of objects. Unlike standard arrays, Vector can dynamically resize itself when elements are added. HashTable stores key-value pairs, LinkedList is a linked list implementation, and Enumeration is an interface for traversing collections.