Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In c++ How would you sort an array by comparing a position in the array. {city: Houston, age: 19, name:joe} {city: Dallas, age: 18, name:Andrew}

In c++ How would you sort an array by comparing a position in the array.

{city: Houston, age: 19, name:joe}

{city: Dallas, age: 18, name:Andrew}

{city: Austin, age: 20, name:bob}

Let's say you have to sort this array by city. How would you get the position the city's name starts at (position 7 from the beginning) and compare each

example:

the H in houston {city: [H]ouston....}

the D in dallas {city: [D]allas....}

the A in Austin {city: [A]ustin....}

so comparing H, D, A so the array sorted looks like this

{city: Austin, age: 20, name:bob}

{city: Dallas, age: 18, name:Andrew}

{city: Houston, age: 19, name:joe}

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

Case Studies In Business Data Bases

Authors: James Bradley

1st Edition

0030141346, 978-0030141348

More Books

Students also viewed these Databases questions

Question

Develop clear policy statements.

Answered: 1 week ago

Question

Draft a business plan.

Answered: 1 week ago

Question

Describe the guidelines for appropriate use of the direct plan.

Answered: 1 week ago