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
B
Correct answer
Explanation
Characteristic variables CAN be created directly from the Query Designer tool in SAP BW. The statement claims they cannot be created, which is false. Therefore, the correct answer is 'False' (option B), indicating that the statement in option A is incorrect.
C
Correct answer
Explanation
A Set is designed to store unique elements and automatically prevents duplicates. Unlike Lists, Sets do not allow duplicate values. Maps store key-value pairs rather than single elements. When uniqueness is the requirement and lookup speed is not critical, a Set is the appropriate choice.
D
Correct answer
Explanation
A Map stores key-value pairs and ensures keys are unique - attempting to store a duplicate key replaces the old entry, effectively preventing duplicates. Collection and List allow duplicates, Set prevents duplicates but doesn't offer key-value mapping. Since the requirement is uniqueness and searching isn't a priority, Map is most suitable.
-
Knowledge discovery of databases
-
Knowledge discovery in databases
-
Knowledge detection in databases
-
None of the above
B
Correct answer
Explanation
KDD stands for Knowledge Discovery in Databases. It is the overall process of discovering useful knowledge from data, encompassing data cleaning, integration, selection, transformation, mining, and interpretation. Note it is 'in' not 'of' - the preposition matters for the correct acronym. This is a foundational concept in data mining and machine learning.
-
MultiProviders
-
Virtual Providers
-
DSO
-
InfoCubes
D
Correct answer
Explanation
In SAP BW, aggregates (pre-summarized data structures for performance) can ONLY be created for InfoCubes (D). MultiProviders (A) are logical views that cannot have aggregates. Virtual Providers (B) provide real-time access and don't support aggregates. DSOs (C) are for data staging, not reporting aggregates.
-
Sort merge
-
Ordered
-
Stable sort
-
none of the above
A,B
Correct answer
Explanation
Sort Merge collects sorted data from multiple partitions. Ordered collection reads all records from one partition before moving to the next. Both are collection methods. Stable Sort is not a standard DataStage collection method.
-
Same
-
Entire
-
Hash By Key
-
Round robin
D
Correct answer
Explanation
Round-Robin is often considered the most efficient partitioning method because it requires no computation - rows are simply distributed in rotation to each partition. Same requires no movement but keeps existing distribution, Entire is expensive (broadcasts all data), Hash requires hash computation. Round-Robin's simplicity makes it fastest for even distribution.
-
a) 2 input links,3 output links and 2 reject links
-
b) 1 input link,any number of output links and 1 reject link.
-
c) 1 input link,3 output links and 1 reject link.
-
None of the above
B
Correct answer
Explanation
The Transformer stage in DataStage accepts one input link, can have any number of output links for routing transformed data, and has one reject link for capturing records that fail transformation rules. This design allows flexible data transformation with multiple output destinations and error handling.
-
Broadcast
-
Replicate
-
Partition by Round-Robin
-
Partition by Key
B
Correct answer
Explanation
Broadcast, Partition by Round-Robin, and Partition by Key are all data partitioning methods in Ab Initio that distribute data across multiple partitions. Replicate, however, is NOT a partitioning method - it copies the entire dataset to every partition (full replication). The key difference is that partitioning divides data (each record goes to one partition), while replication duplicates it (every record goes to all partitions).
-
SEQUENTIAL
-
RANDOM
-
DYNAMIC
-
NONE OF THE ABOVE
C
Correct answer
Explanation
DYNAMIC access mode allows programmers to access records sequentially or randomly on the same file in COBOL. SEQUENTIAL and RANDOM modes limit record retrieval to their respective patterns only. Therefore, DYNAMIC is the correct choice because it is the only mode that permits both access methodologies.
-
A recursive function is a special function that calls itself.
-
A recursive function allows us to break down a complex problem in small parts.
-
It must have an exit condition.
-
The first function call should be the first one to complete.
-
Recursion method is applied in many algorithms such as quick sort or binary sort.
D
Correct answer
Explanation
One of the properties of recursive functions is that a given function call must wait for the following function calls to complete its run before it itself can finish. The innermost function call must be completed before we can finish the next inner function call. We must make sure that the first function call (the outermost one) will be the last one to complete.
-
LinkedList
-
Binary Tree
-
Stack
-
Queue
-
Array
D
Correct answer
Explanation
A queue is a data structure which stores the data in First In First Out Mode. A queue consists of two sides - front and rear. The nodes are added from the rear side and removed from the front side just like people join a queue from the end and pull out from the beginning in a real life queue. The node that was added the first is also the first one to be removed.
-
Insertion sort
-
Selection sort
-
Bubble sort
-
Merge Sort
-
Deep Sort
E
Correct answer
Explanation
Deep sort is not a valid sort type.
-
Preorder
-
Linear
-
Level Order
-
Inorder
-
Postorder
A
Correct answer
Explanation
The preorder traversal of a tree reads the node in root, left, right order. The data of a node will be read first, if the node has a left child node it will be accessed next, followed by the right child node.