SarthakKeshari / CPP-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
45 stars 132 forks source link

Vector Sort #484

Open itsooof opened 3 years ago

itsooof commented 3 years ago

Enter your question -

You are given N integers. Sort the N integers and print the sorted order. Store the N integers in a vector. Vectors are sequence containers representing arrays that can change in size.

Declaration:

vectorv; (creates an empty vector of integers) Size:

int size=v.size(); Pushing an integer into a vector:

v.push_back(x);(where x is an integer.The size increases by 1 after this.) Popping the last element from the vector:

v.pop_back(); (After this the size decreases by 1) Sorting a vector:

sort(v.begin(),v.end()); (Will sort all the elements in the vector)

Enter link to the question(if question belongs to any online platform) -

https://www.hackerrank.com/challenges/vector-sort/problem

Tags for the question(eg - Array, Basic, Stack, etc.) -

Sorting

itsooof commented 3 years ago

Please assign this issue to me @SarthakKeshari

SarthakKeshari commented 3 years ago

@itsooof, Kindly add your solution to "hackerrank" folder. Deadline - 18/10/2021

This Issue will only be counted towards ranking criteria of this repository.

Gentle advice- A bit more tough questions would be appreciated for Hacktoberfest tag.