Question 5 (Sorting) Write down the list content at the end of each iteration of the main loop (ie. end of each pass) of Insertion Sort for the following list: [14,12,7,4,18,9]
Types of Linked List
A sequence of data elements connected through links is called a linked list (LL). The elements of a linked list are nodes containing data and a reference to the next node in the list. In a linked list, the elements are stored in a non-contiguous manner and the linear order in maintained by means of a pointer associated with each node in the list which is used to point to the subsequent node in the list.
Linked List
When a set of items is organized sequentially, it is termed as list. Linked list is a list whose order is given by links from one item to the next. It contains a link to the structure containing the next item so we can say that it is a completely different way to represent a list. In linked list, each structure of the list is known as node and it consists of two fields (one for containing the item and other one is for containing the next item address).
Application: Apply
The following questions ask you to manually apply an algorithm introduced in the lecture and demonstrate your understanding by describing intermediate states of the computation.
Question 5 (Sorting)
Write down the list content at the end of each iteration of the main loop (ie. end of each pass) of Insertion Sort for the following list:
[14,12,7,4,18,9]
Use one line for each pass.
Question 6 (Graph Traversal)
Apply Depth First Search (DFS) to traverse the following graph. Start your traversal from vertex 0, and write down the order in which vertices will be visited during the traversal. (image for this question also attached)
Question 7 (Gaussian elimination) (image for this question also attached)
Apply forward elimination to this system of linear equations to put it into the upper triangular form.
⎛⎝⎜⎜1 1 2225−12−1⎞⎠⎟⎟⎛⎝⎜⎜? ? ?⎞⎠⎟⎟=⎛⎝⎜⎜6 3 13⎞⎠⎟⎟(12−1 122 25−1)(� � �)=(6 3 13)
Write each row operation you use to solve the problem.
Find the values of x, y, and z using back substitution.
Write the matrix and the right-hand side after each row operation, for example, the initial matrix and right-hand side can be represented as:
A = [ [1, 2, -1],
[1, 2, 2],
[2, 5, -1] ]
b = [6, 3,13]
Note: Do NOT write code. Show the values in A and b after each row operation and then find the values of x, y and z using back substitution.
Step by step
Solved in 4 steps with 1 images
May I ask for the answer and explanation for question 7?