Question

1. Explain the significance of Breadth-First Search in graphs and its time complexity. List down any 4 (four) applications of

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1)BFS is Breadth first search.This algorithm selects a single node in a graph and then visits all the nodes adjacent to the selected node.Once BFS visits and marks the starting node, then it moves towards the nearest unvisited nodes and analyses them. all nodes are marked when once visited. until all the nodes of the graph have been visited and marked these iterations continue.

->It helps find shortest path while traversing in smallest number of iterations.

->It is more accurate when compared to other algorithms.

time complexity:

O(V+E) where V is number of vertices in the graph and E is number of edges in the graph.

V * (O(1) + O(Eaj) + O(1))
V + V * Eaj + V
2V + E(total number of edges in graph)
V + E

applications:

Network broadcasting,web crawlers,P2P networks,unweighted graph,navigation systems.

2)stack follows LIFO procedure.backtracking considers searching every possible way for solving a computational problem.

So if you consider looking for a path in a game to complete in shortest moves.It visits the first choice and moves to the next one if it cant find the best possible choice, it backtracks the previous choice and takes the other path checking for in depth and all possible opportunities.

Add a comment
Know the answer?
Add Answer to:
1. Explain the significance of Breadth-First Search in graphs and its time complexity. List down any...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • For each of the following, give the Big-O time and explain your answer: a. Breadth-first search/traversal...

    For each of the following, give the Big-O time and explain your answer: a. Breadth-first search/traversal using an adjacency matrix. b. Breadth-first search/traversal using an adjacency list. c. Depth-first search/traversal using an adjacency matrix. d. Depth-first search/traversal using an adjacency list.

  • (5 marks) a. The pseudo-code for breadth-first search, modified slightly from Drozdek,1 is as follows: void...

    (5 marks) a. The pseudo-code for breadth-first search, modified slightly from Drozdek,1 is as follows: void breadthFirstSearch (vertex w) for all vertices u num (u) 0 null edges i=1; num (w) i++ enqueue (w) while queue is not empty dequeue ( V= for all vertices u adjacent to v if num(u) is 0 num (u) = i++; enqueue (u) attach edge (vu) to edges; output edges; Now consider the following graph. Give the breadth-first traversal of the graph, starting from...

  • Programming Traversal Methods in C++ (depth first & breadth first) Need solution ASAP any help is...

    Programming Traversal Methods in C++ (depth first & breadth first) Need solution ASAP any help is much appreciated. read a set of data representing a directed, unweighted graph build an in-memory graph structure using the data display the graph using depth-first traversal display the graph using breadth-first traversal Input data - The data consists of records like this: 16 3 15 4 -1 This represents a vertex 16 with neighbors 3, 15, and 4. The -1 is the indicator that...

  • Sorting Sort the following array using the quick sort algorithm: (4 Marks) a. 12 26 8...

    Sorting Sort the following array using the quick sort algorithm: (4 Marks) a. 12 26 8 9 7 0 4 Pivot selection is defined to be the first element of each sub-list. Show the array before and after each quicksort round (when the array is partitioned after placing the pivot at its correct position). Also, clearly highlight the pivot in each partition b. Consider an unsorted array of integers of size n. Write a Java program to arrange the array...

  • 1. (a) State any three characteristic of physicist. marks) (b) Explain the merits of using SI...

    1. (a) State any three characteristic of physicist. marks) (b) Explain the merits of using SI units for measurement marks) (c) State the three fundamental mechanical quantities marks) (d) Copy and complete the Physical Quantity table below. marks) Physical quantity Units Symbol Amount of substance Mol Electric current Length M Mass kg Time Second kelvin K Luminous intensity Candela A (& 2. (a) Tabulate four differences between Mass and weight. (b) State four reliable instrument for measuring the temperature of...

  • help me answer the following questions please 1. Stack (LIFO) & its application 1. Stack overflow...

    help me answer the following questions please 1. Stack (LIFO) & its application 1. Stack overflow & underflow 2. Implementation: partially filled array & linked list 3. Applications: reverse string, backtracking Exercises: 1) Which of the following applications may use a stack? A. parentheses balancing program. B. Keeping track of local variables at run time. C. Syntax analyzer for a compiler. D. All of the above. 2) Consider the usual algorithm for determining whether a sequence of parentheses is balanced....

  • Please to indent and follow structure!!!!! Assignment 3 - The card game: War Due Date: June...

    Please to indent and follow structure!!!!! Assignment 3 - The card game: War Due Date: June 9th, 2018 @ 23:55 Percentage overall grade: 5% Penalties: No late assignments allowed Maximum Marks: 10 Pedagogical Goal: Refresher of Python and hands-on experience with algorithm coding, input validation, exceptions, file reading, Queues, and data structures with encapsulation. The card game War is a card game that is played with a deck of 52 cards. The goal is to be the first player to...

  • must be coded in c++ without any STL libraries sadly :( so im struggling on this...

    must be coded in c++ without any STL libraries sadly :( so im struggling on this problem, any help would be greatly appreciated, thanks in advance! :) assignment is due tomorrow and im really struggling on this last question :( a. Begin by implementing a BST for integers. The underlying structure is a linked list. You need these methods: i. BST(); -- Constructor ii. void put (int) – Inserts a value into the BST. iii. Void put(int[] a) – Inserts...

  • Write a c++ program in that file to perform a “Search and Replace All” operation. This...

    Write a c++ program in that file to perform a “Search and Replace All” operation. This operation consists of performing a case-sensitive search for all occurrences of an arbitrary sequence of characters within a file and substituting another arbitrary sequence in place of them. Please note: One of the biggest problems some students have with this exercise occurs simply because they don’t read the command line information in the course document titled “Using the Compiler’s IDE”. Your program: 1. must...

  • Item 1 Original Source Material Student Version Even though the first digital prototype was not fully...

    Item 1 Original Source Material Student Version Even though the first digital prototype was not fully functional, designers were able to emulate playing the game by selecting diffusion activities and staff members. Through this interaction, designers noticed that players would need to move the mouse from one side of the monitor to the other for every single turn in the game. Designers also realized that the natural order of the "Activity" and "Staff members" sections were inverted because players need...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT