The data structure useful for the breadth first search of a
The data structure useful for the breadth first search of a graph is
The data structure useful for the breadth first search of a graph is
Akilesh Kharvi ? Dec 8 '2016 at 22:11
Answer: queue
Explanation:
BFS starts visiting vertices of a graph at an arbitrary vertex by marking it as
visited.
• It visits graph’s vertices by across to all the neighbors of the last visited vertex
• Instead of a stack, BFS uses a queue
Merge sort uses
Akilesh Kharvi ? Dec 8 '2016 at 22:9
Answer: divide and conquer methodology
Explanation:
In computer science, merge sort (also commonly spelled mergesort) is an O(n log n) comparison-based sorting algorithm. Most implementations produce a stable sort, which means that the implementation preserves the input order of equal elements in the sorted output. Mergesort is a divide and conquer algorithm that was invented by John von Neumann in 1945.
Reference: https://en.wikipedia.org/wiki/Merge_sort
A municipality stored details about every house in its perview as a ‘structure'. each containing a large number of details. These are to be sorted. The best approach is
Akilesh Kharvi ? Dec 8 '2016 at 22:3
Answer: store pointers to them in an array and sort the array
Explanation:
In general, an array of pointers can be used to point to an array of data items with each element of the pointer array pointing to an element of the data array. Data items can be accessed either directly in the data array, or indirectly by dereferencing the elements of the pointer array. The advantage of a pointer array is that the pointers can be reordered in any manner without moving the data items.
For example, the pointer array can be reordered so that the successive elements of the pointer array point to data items in sorted order without moving the data items. Reordering pointers is relatively fast compared to reordering large data items such as data records or strings. This approach saves a lot of time, with the additional advantage that the data items remain available in the original order.
The height of a binary tree is defined as the maximum number of edges in any path from the root to the leaf. The maximum number of nodes in any binary tree of height h is
Akilesh Kharvi ? Dec 8 '2016 at 21:59
Answer: \(2^{h+1}-1\)
Explanation:
The number of nodes in a binary tree of height h is at least h + 1, and at most \(2^{h+1}-1\) here h is the depth of the tree.
reference: http://en.wikipedia.org/wiki/Binary_tree#Properties_of_binary_trees
The best method to rearrange books in a library shelf at the end of the day is
Akilesh Kharvi ? Dec 8 '2016 at 20:31
Answer : insertion sort
Explanation:
Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time.
Library sort, or gapped insertion sort is a sorting algorithm that uses an insertion sort, but with gaps in the array to accelerate subsequent insertions.Reference :https://en.wikipedia.org/wiki/Insertion_sort
https://en.wikipedia.org/wiki/Library_sort