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
  1. Generated key port is generated for each REDEFINES clause

  2. Generated key port is generated for each OCCURS clause

  3. Generated Column ID is generated for each OCCURS clause

  4. Generated Column ID is generated for each REDEFINED clause

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

In Normalizer transformation for COBOL files, a Generated Key port is created for each REDEFINES clause (identifies which redefinition is active). A Generated Column ID is created for each OCCURS clause (identifies the occurrence position). The reverse mappings in options B and D are incorrect.

Multiple choice technology
  1. With a normal join, the Integration Service discards all rows of data from the master and detail source that do not match, based on the condition.

  2. A master outer join keeps all rows of data from the master source and the matching rows from the detail source. It discards the unmatched rows from the detail source

  3. A detail outer join keeps all rows of data from the detail source and the matching rows from the master source. It discards the unmatched rows from the master source

  4. A full outer join discards all rows of data from both the master and detail sources.

Reveal answer Fill a bubble to check yourself
B,C,D Correct answer
Multiple choice technology
  1. Stored Procedure Transformation

  2. XML Transformation

  3. HTTP Transformation

  4. Transaction Control Transformation

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

Transaction Control Transformation in Informatica PowerCenter is specifically designed to manage commit and rollback operations for various target types including relational databases, XML sources, and IBM MQSeries targets. It allows you to define conditions that determine when to commit or rollback transactions based on business logic or data conditions. The other transformations listed serve different purposes - Stored Procedures execute database procedures, XML handles XML data, and HTTP makes web service calls.

Multiple choice technology programming languages
  1. Using Redim Keyword

  2. Using Preserve Keyword

  3. Using Reserve Keyword

  4. None of the above

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

The Preserve keyword in VB.NET is used with ReDim to resize an array while retaining existing values. Without Preserve, ReDim would create a new array and lose all existing data. Options A and C are not valid keywords for this purpose.

Multiple choice technology programming languages
  1. Using Redim Keyword

  2. Using Preserve Keyword

  3. Using Reserve Keyword

  4. None of the above

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

The Preserve keyword in VB.NET is used with ReDim to resize an array while retaining existing values. Without Preserve, ReDim would create a new array and lose all existing data. Options A and C are not valid keywords for this purpose.

Multiple choice technology
  1. True

  2. False

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

Effective information architecture often hybridizes multiple structural patterns. For example, a website might use hierarchical navigation menus while also incorporating linear tutorials or database-driven search functionality. This flexibility allows designers to match structure to content type and user needs rather than forcing content into a single pure structure.

Multiple choice technology
  1. True

  2. False

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

HTML allows combining different navigation structures like linear (sequential pages) and hierarchical (tree-based menus) within the same website. You can use linear structure for tutorials and hierarchical for main navigation, making the statement true.

Multiple choice technology programming languages
  1. By calling ReverseSort()

  2. By calling SortReverse()

  3. By calling Descend()

  4. By calling Sort() and then Reverse() methods

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

Standard arrays in languages like C# or JavaScript do not have direct methods like ReverseSort or Descend. Sorting in descending order is typically accomplished by sorting in ascending order first and then reversing the array.

Multiple choice technology
  1. arr[n].length();

  2. arr.size;

  3. arr.size-1;

  4. arr[n].length;

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

In Java, arrays use the length property rather than a method length() or size property to determine their size. Since arr[n] refers to a 1D integer array, arr[n].length correctly retrieves its size.

Multiple choice technology mainframe
  1. SET

  2. SEARCH

  3. PERFORM

  4. All the above

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

In COBOL, the INDEX command creates an index for a table that can then be used by the SEARCH statement to efficiently locate specific table entries. The SEARCH operation requires an index to perform optimized lookups through the table.

Multiple choice technology architecture
  1. Avoid direct coupling

  2. Maintain low coupling and high reusability

  3. None of the above

  4. Both A and B

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

The Indirection pattern supports low coupling and reusability by assigning responsibility to an intermediate object that mediates between other components. This avoids direct coupling between components, making the system more flexible and reusable. Option D correctly captures both benefits.

Multiple choice technology programming languages
  1. int *ptr = (int *) malloc(10, sizeof(int));

  2. int *ptr = (int *) calloc(10, sizeof(int));

  3. int *ptr = (int *) malloc(10*sizeof(int));

  4. int *ptr = (int *) alloc(10*sizeof(int));

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

malloc(10*sizeof(int)) correctly allocates space for 10 integers. Option C is correct - it multiplies the element count by the size of each element. malloc() takes a single byte count argument, while calloc(10, sizeof(int)) initializes to zero but allocates the same size. Option A's malloc(10, sizeof(int)) is incorrect syntax - malloc doesn't take two arguments.