Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The first row contains the names of the columns. The following rows contain values. For example, the table below is presented by the following string:

The first row contains the names of the columns. The following rows contain values.\ For example, the table below is presented by the following string:

S=

"id,name,age,act.,room,dep.

ln1,Jack,68,T,13,8Vn17,Betty,28,F,15,7

".\ Write a function:\

int solution(char ***S, char ^((

)

***)C );

\ which, given two strings S and C consisting of N and M characters, respectively, returns the maximum value in column C of the table described by S.\ Examples:\ Given S = "id,name,age,act.room,dep.

ln1

, Jack,

68,T,13,(8)/()\ 17,Betty,28,F,15,7

" and

C=

"age", your function should retum 68 since 68 is the maximum of 68 and 28.\ Given S = "area,land\ 3722,CMn6612,RU\ 3855,CA\ 3797,USA" and C = "area",\ your function should return 6612.\ Given

S=

city,temp2,temp\ Paris,7,-3\ Dubai,

4,-(4)/()\

Porto,

-1,-2

" and

C=

"temp",\ your function should return -2 .\ Assume that:\

S

is a string of length

N

in CSV format;\

N

is an integer within the range [3..100,000];\

M

is an integer within the range [1..5];\ there are at least two rows;\ each row has the same, positive number of cells;\ each cell is of length [1..5] and consists only of letters, digits and/or special characters: " - - ;\ C is the name of a unique column in the table, whose values are integers within the range [-9999..9999]; there are no erroneous values in this column;\ there is no new line at the end of string

S

.

image text in transcribed
You are given strings S and C. String S represents a table in CSV (comma-separated values) format, where rows are separated by new line characters ('n') and each row consists of one or more fields separated by comme The first row contains the names of the columns. The following rows contain values. For example, the table below is presented by the following string: S= "id,name,age,act.,room,dep. ln1,Jack,68,T,13,8 17,Betty,28,F,15,7". You are given strings S and C. String S represents a table in CSV (comma-separated values) format, where rows are separated by new line characters ('n') and each row consists of one or more fields separated by comme The first row contains the names of the columns. The following rows contain values. For example, the table below is presented by the following string: S= "id,name,age,act.,room,dep. ln1,Jack,68,T,13,8 17,Betty,28,F,15,7

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+applying to all or most employers and employees?

Answered: 1 week ago

Question

=+associated with political parties and if so, which ones? Are

Answered: 1 week ago