Set 1 Computer Science Algorithm and Data structure quiz

Quiz Description

In this algorithm quiz, we would see that we follow a set of particular rules often, maybe when solving a quadratic equation, or when cooking, or when executing a particular task. These instructions that are aimed at disciplining oneself before the execution of a task are what we call Algorithms. Programmers use algorithms all the time to finish particular tasks. We are going to see terms like arrays, records, pointers, linked lists, stacks, queues, recursion, trees, sorting and searching, and learn all before the end of this quiz.

An algorithm is simply a set of finite instructions that aid you in the completion of a certain task. A typical example could be long division.

The data structure is a data organization, management, and storage format that enables efficient access and modification. More precisely, a data structure is a collection of data values as well as the relationships among them, and the functions or operations that can be applied to the data. The type of data structures are,

• Linear: arrays, lists.
• Tree: binary, heaps, space partitioning etc.
• Hash: distributed hash table, hash tree etc.
• Graphs: decision, directed, acyclic etc.

More quizzes can be found here after you have seen as you answer questions on this quiz. More quizzes on Computer science can be found at Computer quizzes.

Nice time!!!

Two main measures for the efficiency of an algorithm are

Correct
• Processor
• Complexity and capacity
• Time and space
• Data and space

The time factor when determining the efficiency of algorithm is measured by

Correct
• Counting microseconds
• Counting the number of keys operations
• Counting the number of statements
• Counting the kilobytes of algorithm

The space factors when determining the efficiency of algorithm is measured by

Correct
• Counting the maximum memory needed by the algorithm
• Counting the minimum memory needed by the algorithm
• Counting the average memory needed by the algorithm
• Counting the maximum disk space needed by the algorithm

Which of the following case does no exist in complexity theory

Correct
• Best case
• Worst case
• Average case
• Null case

The worst case occurs in linear search algorithm when

Correct
• Item is somewhere in the middle of the array
• Item is not in the array at all
• Item is the last element in the array
• Item is the last element in the array or is not there at all

The average case occurs in linear search algorithm

Correct
• When item is somewhere in the middle of the array
• When item is not in the array at all
• When item is the last element in the array
• When item is the element is the array or is not there at all

The complexity of the average case of an algorithm is

Correct
• Much more complicated to analyze than of wort case
• Much more simpler to analyze than that of worst case
• Sometimes more complicated and some other times simpler than that of worst case
• None of the above

The complexity of linear search algorithm is

Correct
• O(n)
• O(log n)
• O(n2)
• O(n log n)

The complexity of binary search algorithm is

Correct
• O(n)
• O(log n)
• O(n2)
• O(n log n)

The complexity of Bubbles sort algorithm is

Correct
• O(n)
• O(log n)
• O(n2)
• O(n log n)

The complexity of merge sort algorithm is

Correct
• O(n)
• O(log n)
• O(n2)
• O(n log n)

The indirect change of the values of a variable in one module by another module is called

Correct
• Internal change
• Inter-module change
• Side effect
• Side-module update

Which of the following data structure is not linear data structure?

Correct
• Arrays
• Both of above
• None of above

Which of the following data structure is linear data structure?

Correct
• Trees
• Graphs
• arrays
• None of above

The operation of processing each element in the list is known as

Correct
• Sorting
• Merging
• Inserting
• Transversal

Finding the location of the elements with a given value is

Correct
• Traversal
• Search
• Sort
• None of above

Arrays are best data structures

Correct
• For relatively permanent collection of data
• For the size of the structure and the data in the structure are constantly changing
• For both of above situation
• For none of above situation

Linked list are best suited

Correct
• For relatively permanent collections of data
• For the size of the structure and the data in the structure are constantly changing
• For both of above situation
• For none of above situation

Each array declaration need not give, implicitly or explicitly, the information about

Correct
• The name of array
• The data type of array
• The first data from the set to be stored
• The index set of the array

The element of an array are stored successively in memory cells because

Correct
• By this way computer can keep track only the address of the first element and the address of others elements can be calculated
• The architecture of computer memory does not allow arrays to store other than serially
• Both of the above
• None of the above