Computer Science, asked by kapil4840, 1 year ago

different between sorting&filtering

Answers

Answered by lastbenchstudent
0

sorting:

it is the way to arrange our data in some defined arrangement. when we use sorting number of data before sorting and after sorting remains same, just order of appearance changes. for example suppose we have some integer data

1, 7, 4 , 3 , 9, 6, 5, 2, 8

now we do sorting in ascending order then result is

1, 2, 3 , 4 , 5 , 6 , 7 , 8, 9

if we do sorting in descending order then result is

9,8,7,6,5,4,3,2,1

Note: number of data remains same

Filtering:

this is the way to filter the data using some condition. in this case number of data gets changed after applying filter. It might have same number of data or less depending upon filter condition.

lets take example of above integer data.

1, 7, 4 , 3 , 9, 6, 5, 2, 8

lets do filter

find data which are greater than 5

so result would be

7, 9, 6,8

get all data which is divisible by 3

result would be

3,9,6

hope it helps you

Similar questions