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 an algorithm to merge the two sorted arrays into the third array. Do not perform the sort function in the third array.
Ans:
void merge(int *a,int *b,int n,int m)
{
int i=0,c[20],j=0,k=0,count=0;
while(i<=n&&j<=m)
if(a[i]
c[k]=a[i];
i++;
k++;
}
if(a[i]>b[j])
c[k]=b[j];
j++;
if(a[i]==b[j])
k++; i++; j++;
count++;
if(i<=n&&j==m)
while(i<=n)
if(i==n&&j<=m)
while(j<=m)
for(i=0;i printf("%d\t",c[i]); }
printf("%d\t",c[i]);
for (i = 0; i sequence of statements } Here, the loop executes n times. Thus, the sequence of statements also executes n times. Since we suppose the time complexity of th
There are three kinds of tree traversals, namely, Postorder , Preorder and Inorder. Preorder traversal: Each of nodes is visited before its children are visited; first the roo
By changing the NULL lines in a binary tree to the special links called threads, it is possible to execute traversal, insertion and deletion without using either a stack or recursi
Ask question find frequency count of function- {for(i=1;i {for(j=1;j {for(k=1;k } } }
Data array A has data series from 1,000,000 to 1 with step size 1, which is in perfect decreasing order. Data array B has data series from 1 to 1,000,000, which is in random order.
One of the best known methods for external sorting on tapes is the polyphase sort. Principle: The basic strategy of this sort is to distribute ordered initial runs of predetermi
The following are several operations on a AA-tree: 1. Searching: Searching is done using an algorithm which is similar to the search algorithm of a binary search tree. 2. Ins
Differentiate between Nonpersistent and 1-persistent Nonpersistent: If the medium is idle, transmit; if the medium is busy, wait an amount of time drawn from a probability dist
Board coloring , C/C++ Programming
A*(B+D)/E-F*(G+H/K)
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