2c03-review - 00041

2c03-review - 00041 -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
10 for(int i=0;i!=size;i++){ cout<<endl<<"("<<i+1<<"):"; cin>>A[i]; } heapSort(A,size); int *F=new int[size];//frequency F[0]=1; for(int i=1;i!=size;i++) if(A[i]==A[i-1]) F[i]=F[i-1]+1; else F[i]=1; int m=0; int l=0; for(int i=1;i!=size;i++) if(F[i]>=m){ m=F[i]; l=i; } cout<<endl<<"======================="<<endl;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cout&amp;lt;&amp;lt;endl&amp;lt;&amp;lt;&amp;quot;Most frequent element: &amp;quot;&amp;lt;&amp;lt;A[l]&amp;lt;&amp;lt;endl; delete F; delete A; } *********************************************************************** * 9.[10] Solve the following recurrences where T(1)=1 and T(n) for n 2 satisfies: a.[5] T(n)=4T(n/3)+n b.[5] T(n)=9T(n/3)+n 2...
View Full Document

Ask a homework question - tutors are online