编写C代码,使用用户选择的排序方法对整数数组(用户输入)进行排序.排序方法可以是基数排序或快速排序.除了最终排序的数组之后... [英] Write C-code that sorts an integer array (user input) using a sorting method of user's choice. The sorting method could be Radix sort or Quick Sort. Apart from the final sorted array After the...

查看:69
本文介绍了编写C代码,使用用户选择的排序方法对整数数组(用户输入)进行排序.排序方法可以是基数排序或快速排序.除了最终排序的数组之后...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,伙计们,请帮帮我.........
编写一个C程序(名为Sort_Search_Grpno.C),该程序使用用户选择的排序方法对整数数组(用户输入)进行排序.排序方法可以是基数排序或快速排序.除了最终的排序数组之外,还为每种排序方法打印以下内容:

1)基数排序:基数排序算法每次迭代的队列(或链).

2)快速排序:数据透视表的值,在每个步骤交换的元素的索引和值.

对数组进行排序后,请用户输入一个整数(键),然后使用二进制搜索在排序后的数组中进行搜索.对于二进制搜索,请打印每次迭代的低,高和中值,以及是否在数组中找到键.


1)包含程序和输出的报告.输出应该是程序实际运行的屏幕截图.

hey guys,plz help me.........
Write a C program (named as Sort_Search_Grpno.C) that sorts an integer array (user input) using a sorting method of user''s choice. The sorting method could be Radix sort or Quick Sort. Apart from the final sorted array, print the following for each sorting method:

1) Radix sort: the queue (or the chain) for each iteration of the radix sort algorithm.

2) Quick sort: the value of pivot, the index and value of elements that are swapped at each step.

After the array has been sorted, take user input for an integer (key) and search it in the sorted array using binary search. For binary search, print the values of low, high and mid for each iteration and whether the key was found in the array or not.


1) A report with the program and the output. Output should be a screen shot from the actual run of the program.

推荐答案

您应该找到此类算法的解释,然后自行实现 .
您可以在Wikipedia上找到介绍性材料:
You should find explanations of such algorithms and then implement yourself them.
You may find introductive material at Wikipedia:
  • Radix sort[^].
  • Quicksort[^].


这不是完成作业的地方.通过为您做作业,我们实际上不会帮您一个忙.您的家庭作业的设置是有充分的理由的,而让别人来做您的作业却会错过您应从中获得的经验.

因此,请尝试一下.如果遇到对您来说很难解决的问题,请咨询您的培训资源或您的老师.如果所有这些都无济于事,您可以考虑在该论坛中提出该特定问题,如果问题足够具体,则可能会得到一些帮助.
This is not the place to get your homework done. By doing your homework for you, we would in fact not do you a favor. Your homework is set for a good reason and by having other people do it for you are missing out on the experience you should gain from it.

So give it try yourself. If run into a problem that looks to hard for you, consult your training resources or your teacher. If all that doesn''t help, you might consider presenting that particular problem in this forum any you might get some help if the question is specific enough.


这篇关于编写C代码,使用用户选择的排序方法对整数数组(用户输入)进行排序.排序方法可以是基数排序或快速排序.除了最终排序的数组之后...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆