0% found this document useful (0 votes)
79 views

Final Exam Advance Algorithm

This document contains an exam answer sheet for a student named Yoseph Martin Lay taking an Advance Algorithm course. The answer sheet includes 4 questions answered by the student: 1) An explanation of how Dijkstra's algorithm works for finding the shortest path in a graph. 2) An explanation of how linear search works by searching through data one by one. 3) That algorithm analysis is done to help readers choose the best algorithms for their solutions. 4) Steps for finding a value's position in a matrix including eliminating rows if the number is too large and columns if it is too small.

Uploaded by

martin
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views

Final Exam Advance Algorithm

This document contains an exam answer sheet for a student named Yoseph Martin Lay taking an Advance Algorithm course. The answer sheet includes 4 questions answered by the student: 1) An explanation of how Dijkstra's algorithm works for finding the shortest path in a graph. 2) An explanation of how linear search works by searching through data one by one. 3) That algorithm analysis is done to help readers choose the best algorithms for their solutions. 4) Steps for finding a value's position in a matrix including eliminating rows if the number is too large and columns if it is too small.

Uploaded by

martin
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

EXAM ANSWER SHEET  

Semester: Odd / Even / Short | Academic Year : 2020 / 2021

           

Student ID   41519010198 Exam Number Student Signature

Name   Yoseph Martin Lay  

Faculty / Study Program Computer Science / Informatics Inspector Signature

Course Name    Advance Algorithm  

Lecturer    Prastika Indriyanti S Kom MCS Mark (00-100)

Schedule   Day Date Time Room  

  Wednesday January, 6 2021 100 min I 502  

1. Explain how a Graph works on Dijkstra's Algorithm for Shortest Path!


Answer:
Dijkstra's algorithm finds the shortest path between a particular node (the so-called "source
node") and all other nodes in the graph. This algorithm uses edge weights to find a path
that minimizes the total distance (weight) between the source node and all other nodes.
Dijkstra's algorithm, (according to its founder Edsger Dijkstra), is an algorithm used in
solving the shortest path problem for a directed graph.

2. Explain how linear search works?


Answer:
Linear Search is a data search technique with all data one by one. If a match is found, the
program will return the output, otherwise the search will continue until the end of the
array. This algorithm is not suitable for large data sets because the complexity of this
algorithm is Ο (n) where n is the number of items. If the data you are looking for is at the
very end of the array, then the program must first.
If data is found, the program will exit the loop. If we want to display the index of the data
we are looking for, we just have to save the index of the array and display it.
Linear search is rarely used practically because other search algorithms such as the binary
search algorithm and hash tables allow significantly faster searching comparison to Linear
search

3. Why do we need algorithm analysis?


Answer:
Algorithm analysis is carried out with the main objective so that readers can make the right
decisions in choosing algorithms for solutions.

4. Explain the steps to find the position of the matrix value in a matrix series!
Answer:
 The number we are searching for is greater than the current number. This will ensure, that all
the elements in the current row is smaller than the number we are searching for as we are
already at the right-most element and the row is sorted. Thus, the entire row gets eliminated
and we continue our search on the next row. Here elimination means we won’t search on that
row again.
 The number we are searching for is smaller than the current number. This will ensure, that all
the elements in the current column is greater than the number we are searching for. Thus, the
entire column gets eliminated and we continue our search on the previous column i.e. the
column at the immediate left
 The number we are searching for is equal to the current number

5.

You might also like