Data-Structures-and-Algorithms icon indicating copy to clipboard operation
Data-Structures-and-Algorithms copied to clipboard

Implementation of Standard Template libraries (STL)

Open Iltwats opened this issue 4 years ago • 5 comments

Give Implementation for the following STLs:--

  1. Sequence Containers: implement data structures which can be accessed in a sequential manner.
  • vector
  • list
  • deque
  • arrays
  • forward_list( Introduced in C++11)
  1. Container Adaptors : provide a different interface for sequential containers.
  • queue
  • priority_queue
  • stack
  1. Associative Containers : implement sorted data structures that can be quickly searched (O(log n) complexity).
  • set
  • multiset
  • map
  • multimap
  1. Unordered Associative Containers : implement unordered data structures that can be quickly searched
  • unordered_set (Introduced in C++11)
  • unordered_multiset (Introduced in C++11)
  • unordered_map (Introduced in C++11)
  • unordered_multimap (Introduced in C++11)

Iltwats avatar Oct 01 '20 15:10 Iltwats

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.98. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

issue-label-bot[bot] avatar Oct 01 '20 15:10 issue-label-bot[bot]

I can help in some of them..

ultimatecoder2 avatar Oct 01 '20 17:10 ultimatecoder2

Ok

On Thu, 1 Oct, 2020, 11:02 pm Deepanshu Jindal, [email protected] wrote:

I can help in some of them..

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Iltwats/hacktoberfest/issues/54#issuecomment-702287126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM5BX6ADZYA25XSAZKZHV4LSIS4JNANCNFSM4SATDCZQ .

--       

www.jecrcuniversity.edu.in http://www.jecrcuniversity.edu.in

ENGINEERING | SCIENCES | MANAGEMENT | HUMANITIES | LAW | AGRICULTURE | HOTEL MANAGEMENT | JOURNALISM MASS COMMUNICATION | DESIGN | * *Important: The information in this email is confidential and may be legally privileged, It is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution is prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Thank you, JECRC University - Disclaimer *"SAVE PAPER.  Good for your planet. Good for your Business" *

Iltwats avatar Oct 02 '20 03:10 Iltwats

@ultimatecoder2 If you choose like vector you have to provide all the basics operation with it, like:

  • size() – Returns the number of elements in the vector.

  • capacity() – Returns the size of the storage space currently allocated to the vector expressed as number of elements.

  • shrink_to_fit() – Reduces the capacity of the container to fit its size and destroys all elements beyond the capacity.

  • at(g) – Returns a reference to the element at position ‘g’ in the vector

  • front() – Returns a reference to the first element in the vector

  • back() – Returns a reference to the last element in the vector

  • data() – Returns a direct pointer to the memory array used internally by the vector to store its owned elements.

  • push_back() – It push the elements into a vector from the back

  • pop_back() – It is used to pop or remove elements from a vector from the back.

  • insert() – It inserts new elements before the element at the specified position

  • erase() – It is used to remove elements from a container from the specified position or range.

  • swap() – It is used to swap the contents of one vector with another vector of same type. Sizes may differ.

  • clear() – It is used to remove all the elements of the vector container

You need not do all of these but basics would be appreciated.

Iltwats avatar Oct 02 '20 06:10 Iltwats

Same goes with all the rest STLs.

Iltwats avatar Oct 02 '20 06:10 Iltwats