The following assessment should be completed in exam conditions (closed book).
Your questions will be automatically submitted after 1 hour unless you have already done so.
The questions within this assessment require a tutor to mark and provide feedback. As such, your final grade will not be shown until your tutor has completed the online feedback.
0 of 14 Questions completed
Questions:
You have already completed the assessment before. Hence you can not start it again.
Assessment is loading…
You must sign in or sign up to start the assessment.
You must first complete the following:
0 of 14 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Grade U
Grade E
Grade D
Grade C
Grade B
Grade A
Grade A*
The array queue shown below is set up to hold a small queue. Assume that there is sufficient storage to hold all necessary additions to the queue.
Shown below is an algorithm that is intended to add an item to the queue.
Identify the parameter that is passed to this procedure.
The array queue shown below is set up to hold a small queue. Assume that there is sufficient storage to hold all necessary additions to the queue.
Shown below is an algorithm that is intended to add an item to the queue.
Describe the logical decision that is made.
This response will be reviewed and graded after submission.
The array queue shown below is set up to hold a small queue. Assume that there is sufficient storage to hold all necessary additions to the queue.
Shown below is an algorithm that is intended to add an item to the queue.
This algorithm contains a logic mistake. Explain what the mistake is.
This response will be reviewed and graded after submission.
The array queue shown below is set up to hold a small queue. Assume that there is sufficient storage to hold all necessary additions to the queue.
Shown below is an algorithm that is intended to add an item to the queue.
This algorithm contains a logic mistake. Rewrite the algorithm to correct the mistake.
This response will be reviewed and graded after submission.
Consider the following algorithm in Fig.2, expressed in pseudocode, as function S:
State the name of the algorithm implemented in Fig.2.
Consider the following algorithm in Fig.2, expressed in pseudocode, as function S:
Describe the purpose of this algorithm in Fig 2.
This response will be reviewed and graded after submission.
The temperatures of an ocean are input into a computer system. They are recorded and will be accessed, in the order in which they arrive. The data for one week is shown:
5, 5.5, 5, 6, 7, 6.5, 6
The data is to be stored in a data structure. The programmer stores the data in a queue.
Explain why a queue is used instead of a stack.
This response will be reviewed and graded after submission.
The temperatures of an ocean are input into a computer system. They are recorded and will be accessed, in the order in which they arrive. The data for one week is shown:
5, 5.5, 5, 6, 7, 6.5, 6
The data is to be stored in a data structure. The programmer stores the data in a queue.
The data is processed. After processing, the value for the first day is stored as 0. The value for each following day is stored as an increase, or decrease, from the first day.
For example: if the first day was 7, the second was 6 and the third was 9, after processing it would be stored as 0, –1, 2.
The queue uses dequeue() to return the first element of the queue.
dequeue() is a function.
Explain why dequeue() is a function, not a procedure.
The temperatures of an ocean are input into a computer system. They are recorded and will be accessed, in the order in which they arrive. The data for one week is shown:
5, 5.5, 5, 6, 7, 6.5, 6
The data is to be stored in a data structure. The programmer stores the data in a queue.
Complete the algorithm to process the data in the queue and store the results in an array called processedData.
processedDaata[0] = 0 firstDay = for count = 1 to 6 processedData[ ] = dequeue() - next count
The temperatures of an ocean are input into a computer system. They are recorded and will be accessed, in the order in which they arrive. The data for one week is shown:
5, 5.5, 5, 6, 7, 6.5, 6
The data is to be stored in a data structure. The programmer stores the data in a queue.
The contents of processedData are shown below.
The data needs to be sorted into ascending order.
Explain how a bubble sort algorithm sorts data. Use the current contents of processedData in your explanation
This response will be reviewed and graded after submission.
A program needs to store the names of plants that are in a garden, so they can be easily found and accessed in alphabetical order.
The data is stored in a tree structure. Part of the tree is shown.
State the type of tree shown in Fig. 2.1.
A program needs to store the names of plants that are in a garden, so they can be easily found and accessed in alphabetical order.
The data is stored in a tree structure. Part of the tree is shown.
Show the output of a breadth-first traversal of the tree shown in Fig. 2.1.
This response will be reviewed and graded after submission.
A program needs to store the names of plants that are in a garden, so they can be easily found and accessed in alphabetical order.
The data is stored in a tree structure. Part of the tree is shown.
Explain how backtracking is used in a depth-first (post-order) traversal. Use the tree in Fig. 2.1 in your explanation.
This response will be reviewed and graded after submission.
Mabel is a software engineer. She is writing a computer game for a client. In the game the main character has to avoid their enemies. This becomes more difficult as the levels of the game increase.
The game’s ‘challenging’ level has intelligent enemies that hunt down the character in an attempt to stop the user from winning. The program plans the enemies’ moves in advance to identify the most efficient way to stop the user from winning the game. The possible moves are shown in a graph. Each node represents a different state in the game. The lines represent the number of moves it will take to get to that state.
Show how Dijkstra’s algorithm would find the shortest path from A to H.
This response will be reviewed and graded after submission.