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 databases
  1. an actor

  2. a director

  3. a year

  4. a movie

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

In a movies database where you're organizing your Top 100 list, each record should represent one movie. The record would contain fields for Title, Actor(s), Director, Year, Genre, etc. A record representing an actor, director, or year would only capture partial information - you want the complete entity (the movie) as your primary record.

Multiple choice technology programming languages
  1. loads a new record into the input buffer if an end-of-record is found in the current record

  2. holds the current data line in the buffer for another input statement to process

  3. can be used to read multiple observations from a single data line

  4. is a syntax error

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

In SAS, double trailing @@ in an INPUT statement holds the current data line in the input buffer, allowing multiple INPUT statements to read data from the same line. This enables reading multiple observations from a single data line, which is the practical use case.

Multiple choice technology mainframe
  1. Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of the array.

  2. An index can only be modified using PERFORM, SEARCH & SET.

  3. Need to have index for a table in order to use SEARCH, SEARCH ALL.

  4. None of the above

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

All statements are true. A subscript represents the occurrence number, while an index represents the displacement. An index can only be modified using PERFORM, SEARCH, and SET. An index is required on a table to use SEARCH or SEARCH ALL. Thus, none of the statements are false.

Multiple choice technology databases
  1. The start value of the sequence is always 1.

  2. The sequence always increments by 1.

  3. The minimum value of an ascending sequence defaults to 1.

  4. The maximum value of descending sequence defaults to 1.

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

In database sequences (such as Oracle), the default minimum value for an ascending sequence is 1. The start value and increment can be customized, and descending sequences default to a different maximum value.

Multiple choice technology programming languages
  1. True

  2. False

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

In Java, ArrayList operations are generally faster than Vector because ArrayList is unsynchronized (not thread-safe) while Vector is synchronized. The synchronization overhead in Vector makes it slower for single-threaded operations. This is a key reason ArrayList was introduced in Java 1.2 as a modern alternative to the legacy Vector class.

Multiple choice technology programming languages
  1. Binary Tree

  2. Hash Table

  3. Stack

  4. None of the Above

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

Hash tables provide O(1) average time complexity for key-based lookups, making them ideal for scenarios requiring fast data retrieval by key. Binary trees have O(log n) lookup time, while stacks follow LIFO order and don't support efficient key-based access.

Multiple choice technology programming languages
  1. Binary Tree

  2. Hash Table

  3. Stack

  4. None of the Above

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

Hash tables provide average O(1) lookup time due to direct indexing through hash functions. Binary trees provide O(log n) lookup. Stacks provide O(1) but only for LIFO access, not general retrieval. Hash tables are fastest on average for general data retrieval.

Multiple choice technology
  1. Reformat

  2. Replicate

  3. Broadcast

  4. Partition by Key

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

The Reformat component specifically transforms the structure or format of data records passing through it. It can change field names, data types, and record layouts. Replicate duplicates data, Broadcast distributes copies, and Partition by Key splits data; none change the record format itself.

Multiple choice technology
  1. Partitioning the records

  2. Sorting the records

  3. Validating the records

  4. Discarding the records

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

The Trash component in Ab Initio is used to discard records from the data flow. It provides a way to filter out unwanted records by routing them to a trash output, effectively removing them from further processing.

Multiple choice technology packaged enterprise solutions
  1. 1

  2. 2

  3. 3

  4. No Limit

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

In Ab Initio Co>Operating system architecture, the Enterprise Server can have exactly one Gateway Server configured. The Gateway handles client connections and routes requests to the Enterprise Server, and this single-instance architecture prevents routing conflicts and maintains centralized control.

Multiple choice technology programming languages
  1. Sorter

  2. Connected Lookup

  3. Expression

  4. Unconnected Lookup

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

In Informatica, an Active transformation changes the number of rows passing through it. The Sorter transformation is active because it can change the row order and, based on configuration, can filter rows (like using 'distinct' sort which removes duplicates). Lookup (both connected and unconnected) and Expression are passive transformations as they maintain the same number of rows.