answersLogoWhite

0

What is pseudocode for bucket sort?

Updated: 8/11/2023
User Avatar

Wiki User

11y ago

Best Answer

input: an array a of length n with array elements numbered 0 to n − 1

inc ← round(n/2)
while inc > 0 do:
for i = inc .. n − 1 do:
tempa[i]
ji
while jinc and a[jinc] > temp do:
a[j] ← a[jinc]
jjinc
a[j] ← temp
inc ← round(inc / 2.2)

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

9y ago

The pseudocode for merge sort is:

MERGE (A, p, q, r )

1. n1 ← q − p + 1 2. n2 ← r − q

3. Create arrays L[1 . . n1 + 1] and R[1 . . n2 + 1]

4. FOR i ← 1 TO n1

5. DO L[i] ← A[p + i − 1]

6. FOR j ← 1 TO n2

7. DO R[j] ← A[q + j ]

8. L[n1 + 1] ← ∞

9. R[n2 + 1] ← ∞

10. i ← 1

11. j ← 1

12. FOR k ← p TO r

13. DO IF L[i ] ≤ R[ j]

14. THEN A[k] ← L[i]

15. i ← i + 1

16. ELSE A[k] ← R[j]

17. j ← j + 1

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

The algorithm and psuedocode of bubble sort can be set at zero and this is a part of the computer programming protocol.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is pseudocode for bucket sort?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the complexity of bucket sort?

o(n)


Is there a a movie called Two tears in a bucket?

Two Tears In A Bucket it a movie about a guy that figures out that his grandfather dies she the guy goes home to sort things out


Types of algorithm?

pseudocode


What is imitation code?

pseudocode


What is a pseudocode design tool?

SPOK (Structured Prose Organizer for KEDIT) is a pseudocode design tool. (SPOK4 at Verizon.Net)


Difference between pseudocode and structured English?

structured English resembles spoken Englishwhere as pseudocode resembles programming languageWhat_are_the_differences_between_structured_English_and_pseudo_code


Develop an algorithm to display all prime numbers from 2 to 100 Give both the pseudocode version and the flowchart version Convert your pseudocode into a Java program?

Develop an algorithm to display all prime numbers from 2 to 100. Give both the pseudocode version and the flowchart version. Convert your pseudocode into a Java program.


How does putting a bucket of liquid water in a room prevent the room from freezing?

not really but it defiantly does have some sort of effect


What language is pseudocode written in?

Pseudocode is more a process description than actual code. Since it is just describing the logic and processes of a proposed program it can be written in ANY written language, note that while it could theoretically be written in a "computer language", that sort of defeats the purpose of the pseudo code which intended for human reading rather than machine reading.


What is the difference between pseudocode and trace table?

pseudocode is a sentence-like representation of a piece of code while a trace table is a technique used to test a algorithms.


How do I access other user buckets?

Bucket 1 Bucket 2 Bucket 3 Bucket 4 Bucket 5 Bucket 5 Bucket 7 Bucket 8 Bucket 9 Bucket 10 Bucket 11 Bucket 12 Bucket 13 Bucket 14 Bucket 15 Bucket 16 Bucket 17 Bucket 18 Bucket 19 Bucket 20


Which piece of pseudocode represents incrementing the loop control called rep?

There is no standard for pseudocode. Pseudocode is generally expected to be intuitively understood by its target audience, but it doesn't need similarity with natural language or familiar programming language. Therefore, all the following are pseudocode examples to increment a variable called rep: rep = rep + 1 add 1 to rep increment rep ++rep next rep