提供高质量的essay代写,Paper代写,留学作业代写-天才代写

首頁 > > 詳細

program設計程序代做、代寫C++編程語言、c++程序代做 代寫Python程序|代寫R語言程序

F. Task(s)
1. Write a program to sort an array of size 10 using both Merge and Quick sort algorithms.
Make sure that both algorithms collaborate to sort one dimensional array, i.e. if merge sort
is applied on the first part of the array then Quick sort must be applied on the other part as
shown in the following figure:
Make sure to follow the following rules:
a. You are not allowed to apply each algorithm on the entire array.
b. If one algorithm applied for one part, then the other algorithm applied to the rest of the
array. For example mergeSort(arr,0,4) then quicksort(arr,5,n-1).
c. Make sure that your code works on any input.
d. Never use any other sorting algorithms.
e. You are only allowed to apply algorithms with O(n) complexity other than Merge and
Quick sort.
f. Make sure that your final array is sorted after both Merge and Quick sort algorithms
finish.
2. Sort elements in ascending order using stack, i.e. make the smallest element to be the top
element of the stack. For example, given the stack elements (from bottom to top): 5, 2, 6,
9, sort the elements to make the stack elements become (from bottom to top): 9, 6, 5, 2.
The only data structure you can use is array-based stack. Given a stack st, use one extra
stack, tmpst, to store temporary data.
Merge sort Quick sort
Not sorted
Sorted
a. Write a C++ program to sort elements in an array-based stack in ascending order.
b. Demonstrate the sorting process with given input numbers {25, 10, 15, 20, 30}.
Algorithm:
pop out the st to a variable tmp until it finishes all elements.
while tmpst is not empty
if the top element of tmpst is smaller than tmp,
pop out tmpst and push that element onto st
push tmp onto tmpst ……
Sample output (Example):
Note: implement the Stack class with all necessary functionality.
APPENDIX 1
MARKING RUBRICS
Component Title Mergesort and Quicksort Percentage
(%) 50
Criteria
Score and Descriptors Weight
(%) Marks
(50-40) (40-30) (30-15) (15-10) (10-0)

聯系我們
  • QQ:1067665373
  • 郵箱:1067665373@qq.com
  • 工作時間:8:00-23:00
  • 微信:Essay_Cheery
熱點文章
程序代寫更多圖片

聯系我們 - QQ: 1067665373 微信:Essay_Cheery
? 2021 uk-essays.net
程序代寫網!

在線客服

售前咨詢
售后咨詢
微信號
Essay_Cheery
微信
全优代写 - 北美Essay代写,Report代写,留学生论文代写作业代写 北美顶级代写|加拿大美国论文作业代写服务-最靠谱价格低-CoursePass 论文代写等留学生作业代做服务,北美网课代修领导者AssignmentBack 北美最专业的线上写作专家:网课代修,网课代做,CS代写,程序代写 代码代写,CS编程代写,java代写北美最好的一站式学术代写服务机构 美国essay代写,作业代写,✔美国网课代上-最靠谱最低价 美国代写服务,作业代写,CS编程代写,java代写,python代写,c++/c代写 代写essay,作业代写,金融代写,business代写-留学生代写平台 北美代写,美国作业代写,网课代修,Assignment代写-100%原创 北美作业代写,【essay代写】,作业【assignment代写】,网课代上代考