0
rearrange array
how can i rearrange array setting special characters first then letter then numbers? it should be arranged by ascii value can anyone help?
12 Respuestas
+ 2
At first seperate the array on the basis of symbol, letter and number and then sort them using their ASCII value
+ 2
sayo i prefer you to do introduction for c++ course first instead of intermediate course
cuz it will help you to understand the basic of C++ like loops,if/else,switch,arrays ,data types and moew!
+ 1
i didn't learn java so i won't understand, anyway thank a lot Ayush Singh
i will try more
+ 1
Alhaaz how to use the vector?
+ 1
sayo , by applying <vector> header file in your code , i think you are currently a beginner so i prefer you to use arrays right now!
+ 1
Alhaaz u r right
thank u I'll try
0
this is array before
{3,c,2,$,b,a,!,1}
and this after using the rearrange function
{!, $, a, b, c, 1,2,3}
0
how can i sort it first?
can you give me the implementation
0
Let me try but I can give it you in Java
0
you can use vector too!
0
sayo
not quite sorted the way you wanted, but sorted nevertheless.
The answer should be use std::sort from <algorithm>
https://code.sololearn.com/cbZ9EPs6nNvV/?ref=app
0
Bob_Li thanks a lot, it is so helpful