Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Q. Describe the basic concept of binary search technique? Is it more efficient than the sequential search?
Ans:
The binary search technique:-
This technique is applied to an ordered list where elements are arranged either in ascending order or descending order. The array is divided into two parts and the item being searched for is compared with item at the middle of the array. If they are equal the search is successful. Otherwise the search is performed in either the first half or second half of the array. If the middle element is greater than the item being searched for the search process is repeated in the first half of the array otherwise the process is repeated in the second half of the array. Each time a comparison is made, the number of element yet to be searched will be cut in half. Because of this division of array into two equal parts, the method is called a binary search.
In binary search, each iteration of the loop halves the size of the list to be searched. Thus the maximum number of key comparisons is approximately
2*log2n. This is quite an improvement over the sequential search, chiefly as the list gets larger. The binary search is, however, not guaranteed to be quicker for searching for small lists. Even though the binary search needs less number of comparisons, each comparison needs more computation or calculation. When n is small, the constant of proportionality can dominate. Therefore, in case of fewer number of elements in the list, a sequential search is enough.
Q. Perform implementation of a queue using a singly linked list L. The operations INSER and DELETE should take O (1) time.
Which of the sorting algorithm is stable Heap sorting is stable.
a) Given a digraph G = (V,E), prove that if we add a constant k to the length of every arc coming out from the root node r, the shortest path tree remains the same. Do this by usin
Draw trace table and determine output from the following flowchart using following data: Number = 45, -2, 20.5
1. You are required to hand in both a hard copy and an electronic copy of the written report on the project described in A, including all the diagrams you have drawn. 2. You
Handout 15 COMP 264: Introduction to Computer Systems (Section 001) Spring 2013 R. I. Greenberg Computer Science Department Loyola University Water TowerCampus, Lewis Towers 524 82
Efficiency of Linear Search How much number of comparisons is there in this search in searching for a particular element? The number of comparisons based upon where the reco
Demonstration of Polynomial using Linked List # include # include Struct link { Char sign; intcoef; int expo; struct link *next; }; Typedefstruct link
An unsorted array is searched through linear search that scans the array elements one by one until the wanted element is found. The cause for sorting an array is that we search
Q. Explain various graph traversal schemes and write their advantages and disadvantages. A n s . Graph Traversal Scheme is explained below In many troubles we wish
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd