×

 0 #include int main() {int arr[100],i,n,t,j; scanf("%d",&n); for(i=0;iarr[j]) {t=arr[i]; arr[i]=arr[j]; arr[j]=t; }}} for(i=0;i

 0 why int arr[100] ? I can see you are solving Turbo sort. answered 05 Oct '14, 19:21 16.9k●49●115●225 accept rate: 11% yes it is turbo sort,and i am using arr[100] so that the user can give input 100 elements ....i have run this code on turbo c and its runs perfectly in it!!! so why am i getting runtime error in this?? (05 Oct '14, 19:38) 1 i am using arr[100] so that the user can give input 100 elements ...and in problem statement it's written, that there can be up to one million elements... (05 Oct '14, 20:03)
 0 i have also done it by taking 1 million elements but then its show time limit exeeded... answered 06 Oct '14, 11:10 1●1 accept rate: 0% because your sorting algorithm is quite slow. Read about Quicksort and Mergesort (06 Oct '14, 11:23) Even that might give a TLE. Try counting sort. (06 Oct '14, 22:57)
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×1,470
×249

question asked: 05 Oct '14, 19:15

question was seen: 957 times

last updated: 06 Oct '14, 23:53