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. Write down the algorithm for binary search. Which are the conditions under which sequential search of a list is preferred over the binary search?
Ans.
Algorithm for the Binary Search is as follows
1. if (low> high)
2. return (-1)
3. Mid = (low + high)/2
4. if ( X = = a[mid])
5. return (mid);
6. if (X < a[mid])
7. search for X in a[low] to a[mid-1]
8. else
9. search for X in a[mid+1] to a[high]
Sequential Search is preferred over the binary search when the list is disorder and haphazardly constructed. When searching is to be done on unsorted list then linear search is the only option.
Q. Let a binary tree 'T' be in memory. Write a procedure to delete all terminal nodes of the tree. A n s . fun ction to Delete Terminal Nodes from Binary Tree
Multidimensional array: Multidimensional arrays can be defined as "arrays of arrays". For example, a bidimensional array can be imagined as a bidimensional table made of elements,
Threaded Binary Tree : If a node in a binary tree is not having left or right child or it is a leaf node then that absence of child node is shown by the null pointers. The spac
What is the difference between a grounded header link list and a circular header link list? A header linked list is a linked list which always having a special node, known as t
In a sorted list, Binary search is carried out by dividing the list into two parts depends on the comparison of the key. Since the search interval halves each time, the iteration o
How divide and conquer technique can be applied to binary trees? As the binary tree definition itself separates a binary tree into two smaller structures of the similar type,
In this unit, the following four advanced data structures have been practically emphasized. These may be considered as alternative to a height balanced tree, i.e., AVL tree.
Q. Reverse the order of the elements on a stack S (i) by using two additional stacks (ii) by using one additional queue. Ans : L e t S be the stac
Linked lists are among the most common and easiest data structures. They may be used to implement various other common abstract data types, including queues, stacks, symbolic expre
need an expert to help me with the assignment
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