Forum Search:
FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.
Calendar
Search
Help
Members
Control Panel
Logout [ CommonCrawl [Bot] ]
Home
Post Form
Logged in user:
CommonCrawl [Bot] [
logout
]
Forum:
HTML, Javascript, jQuery & AJAX
Title:
Poll:
[CREATE POLL]
Message Icon:
No Icon
Smiley Shortcuts:
[
list all smilies
]
Formatting Tools:
Size
1
2
3
4
5
6
7
Color
Sky Blue
Royal Blue
Blue
Dark Blue
Orange
Orange Red
Crimson
Red
Firebrick
Dark Red
Green
Lime Green
Sea Green
Deep Pink
Tomato
Coral
Purple
Indigo
Burly Wood
Sandy Brown
Sienna
Chocolate
Teal
Silver
Font
Arial
Times
Courier
Century
Body:
Forum Options:
HTML
code is
off
BBcode
is
on
Images
are
on
Smilies
are
on
Editing Time Limit
: Unlimited
[quote title=pixielott wrote on Tue, 15 September 2020 10:42]Hey, Which one from the below code blocks is using bubble sort: 1) [code]for(int i=0;i<n-1;i++) for(int j=n-1; j>i;j--) if(a[j] < a[j-1]) swap(a[j], a[j-1]);[/code] 2) [code]for(int i=0; i<n-1; i++) for(int j=i+1; j<n; j++) if(a[j] < a[i]) swap(a[j],a[i]);[/code] 3) [code]int temp, i, j = 0; boolean swaped = true; while (swaped) { swaped = false; j++; for(i = 0; i < arr.length - j; i++){ if(arr[i] > arr[i+1]){ temp = arr[i]; arr[i] = arr[i+1]; arr[i+1] = temp; swaped = true; } } }[/code] I guess,the first is bubble sort, not sure of the second and third. [/quote]
File Attachments:
Allowed File Extensions:
jpg jpeg png gif txt doc gz bz2 inc php zip diff
Maximum File Size:
1024KB
Maximum Files Per Message:
3
Options:
Post Notification
Notify me when someone replies to this message.
Include Signature
Include your profile signature.
Disable smilies in this message
Topic View
Post by steveskok is ignored
Post by pixielott is ignored
Current Time:
Tue Aug 09 07:21:36 EDT 2022
Total time taken to generate the page: 0.00761 seconds