PRESENTED BY: 17040603 RAJKRISHNADEEPAK.VUYYURU 17035523 SWAMYCHANDAN.DONDAPATI 17028670 VINESHKUMARREDDY.LANKA 17040235 RAJSEKHARTIRUMALA KANDURI ALAN.

Slides:



Advertisements
Similar presentations
M The University Of Michigan Andrew M. Morgan EECS Lecture 22 Savitch Ch. 16 Intro To Standard Template Library STL Container Classes STL Iterators.
Advertisements

Chapter 3 – Lists A list is just what the name implies, a finite, ordered sequence of items. Order indicates each item has a position. A list of size 0.
SEG4110 – Advanced Software Design and Reengineering TOPIC J C++ Standard Template Library.
Collections Chapter Java Collection Frameworks The Java collection framework is a set of utility classes and interfaces. Designed for working with.
Chapter 6 Queue. Learning Objectives ● Describe the behavior of a queue. ● Enumerate the primary operations supported by a queue. ● Learn about the UNIX.
Data Structure Dr. Mohamed Khafagy.
Beginning C++ Through Game Programming, Second Edition
CS 307 Fundamentals of Computer Science 1 Abstract Data Types many slides taken from Mike Scott, UT Austin.
. STL: C++ Standard Library. Main Ideas u General purpose: generic data structures & algorithms, templates u Flexibility: Allows for many combinations.
1 L41 Collections (1). 2 OBJECTIVES  What collections are.  To use class Arrays for array manipulations.  To use the collections framework (prepackaged.
More on the STL vector list stack queue priority_queue.
Main Index Contents 11 Main Index Contents Container Types Container Types Sequence Containers Sequence Containers Associative Containers Associative Containers.
Main Index Contents 11 Main Index Contents Container Types Container Types Sequence Containers Sequence Containers Associative Containers Associative Containers.
C++ Programming: Program Design Including Data Structures, Second Edition Chapter 22: Standard Template Library (STL)
Data Structures Using C++1 Chapter 13 Standard Template Library (STL) II.
Rossella Lau Lecture 12, DCO10105, Semester B, DCO10105 Object-Oriented Programming and Design  Lecture 12: An Introduction to the STL  Basic.
CSIS 123A Lecture 12 Templates. Introduction  C++ templates  Allow very ‘general’ definitions for functions and classes  Type names are ‘parameters’
Sorting and Vectors Mechanism for representing lists JPC and JWD © 2002 McGraw-Hill, Inc. Modified by S. Sudarshan.
Data Structures Using C++ 2E
Chapter 3 List Stacks and Queues. Data Structures Data structure is a representation of data and the operations allowed on that data. Data structure is.
Data Structures and Abstract Data Types "Get your data structures correct first, and the rest of the program will write itself." - David Jones.
C++ How to Program, 8/e © by Pearson Education, Inc. All Rights Reserved.
Main Index Contents 11 Main Index Contents Week 3 – The Vector Container.
Comp 245 Data Structures Linked Lists. An Array Based List Usually is statically allocated; may not use memory efficiently Direct access to data; faster.
111 © 2002, Cisco Systems, Inc. All rights reserved.
Generic Programming Using the C++ Standard Template Library.
Generics and Collections. Introduction Generics New feature of J2SE 5.0 Provide compile-time type safety Catch invalid types at compile time Generic methods.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 – Data Structures Standard Template Library (STL)
Data Structures Using C++ 2E Chapter 13 Standard Template Library (STL) II.
C++ STL CSCI 3110.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 22: Standard Template Library (STL)
Data Structures and Algorithms Lecture 1 Instructor: Quratulain Date: 1 st Sep, 2009.
Chapter 9: Part 2: Vectors + Maps and STL Overview JPC and JWD © 2002 McGraw-Hill, Inc. Modified by S. Sudarshan.
Understanding Data Types and Collections Lesson 2.
Standard Template Library The Standard Template Library was recently added to standard C++. –The STL contains generic template classes. –The STL permits.
Iterator for linked-list traversal, Template & STL COMP171 Fall 2005.
CS 403, Class 23Slide #1 CS Programming Languages Class 23 November 16, 2000.
The ADT Table The ADT table, or dictionary Uses a search key to identify its items Its items are records that contain several pieces of data 2 Figure.
Collections Data structures in Java. OBJECTIVE “ WHEN TO USE WHICH DATA STRUCTURE ” D e b u g.
Lecture 7 : Intro. to STL (Standard Template Library)
Intro to the C++ STL Timmie Smith September 6, 2001.
STL CSSE 250 Susan Reeder. What is the STL? Standard Template Library Standard C++ Library is an extensible framework which contains components for Language.
Introduction The STL is a complex piece of software engineering that uses some of C++'s most sophisticated features STL provides an incredible amount.
C++ Review STL CONTAINERS.
CMSC 202 Containers and Iterators. Container Definition A “container” is a data structure whose purpose is to hold objects. Most languages support several.
CS212: Object Oriented Analysis and Design Lecture 26: STL Containers.
Unit VI.  C++ templates are a powerful mechanism for code reuse, as they enable the programmer to write code (classes as well as functions) that behaves.
1 The Standard Template Library The STL is a collection of Container classes These are class templates for containers. A container is an object that stores.
List Structures What is a list? A homogeneous collection of elements with a linear relationship between the elements linear relationship - each element.
Object-Oriented Programming (OOP) Lecture No. 41
Standard Template Library
CS212: Object Oriented Analysis and Design
Set Collection A Bag is a general collection class that implements the Collection interface. A Set is a collection that resembles a Bag with the provision.
Programming with ANSI C ++
Standard Template Library
Standard Template Library (STL)
CMSC 341 Lecture 5 Stacks, Queues
structures and their relationships." - Linus Torvalds
Chapter 22: Standard Template Library (STL)
Generic Programming Karl Lieberherr 12/1/2018 Generic Programming.
CS212: Object Oriented Analysis and Design
Copyright © – Curt Hill STL List Details Copyright © – Curt Hill.
Queues Jyh-Shing Roger Jang (張智星)
Fundaments of Game Design
Standard Template Library
Standard Template Library
structures and their relationships." - Linus Torvalds
A dictionary lookup mechanism
Presentation transcript:

PRESENTED BY: RAJKRISHNADEEPAK.VUYYURU SWAMYCHANDAN.DONDAPATI VINESHKUMARREDDY.LANKA RAJSEKHARTIRUMALA KANDURI ALAN GOUDE

 A generic library to manage collections of data with efficient algorithms.  The STL is a complex piece of software engineering that uses some of C++'s most sophisticated features  The Standard Template Library is mainly composed of generic container class templates and a set of many efficient template algorithms designed to work with, and manipulate, the containers.  The classes declared and defined in STL use templates to their fullest capacity, enabling truly generic programming for C++ programmers.  The template syntax that describes the STL can seem quite intimidating.  Although it looks more complicated than it is actually, while there is nothing in STL that is any more difficult than the other features of C++.  STL defines various routines that access them. Because the STL is constructed from template classes, the algorithms and data structures can be applied to nearly any type of data. STANDARDTEMPLATELIBRARYSTANDARDTEMPLATELIBRARY

ITERATOR ALGORITHM ITERATOR  STRUCTURAL FLOW OF STL COMPONENTS

 CONTAINER  Container classes are c++ classes that act as container for other objects, suchasanarrayor a linked list.  A common type of a container is it's an "Array", a built in feature of c++.containers are more powerful, flexible than arrays.  Containers have its own memory as well as its track record of objects they hold.  Container classes provide structured, dynamic storage in reusable modules that you can easily plug in to any program where they might be needed  Containers are called as building blocks as they are used to create object -oriented programs and which make the internals of a program to construct more easily.

 CONTAINERS

 Queue  Queue is also known as “ First IN First OUT ".  Queue is a data structure that represents a line.  The elements that are placed in the queue are the longest one in the queue that can be accessed first.  The data items enter the queue at the Rear and leaves from the Front  The operation used to enter the data item into the queue is called Enqueue and operation used to remove the data item is called Dequeue.  syntax  Template > class queue T--> type of data being stored

 MEMBER FUNCTIONS OF QUEUE

 Map:  The map class provides look up using a rapid key based look up.  Duplicates are not allowed.  The elements in the map are in the form of pairs containing keys and values.   Insertions and deletions are possible at any where in the map.  To insert an element into map requires a pair object that has the key and a value.  The map cannot store more than one value against each key because each key can only appear once, if you try and add a second instance of the same key, then that will supersede the existing one.

 Some Map Access Functions Purpose   begin() Returns iterator pointing to first element  end() Returns iterator pointing _after_ last element  swap(, ) Swap two elements  insert(, ) Insert a new element  size() Number of elements in map  max_size() Maximum possible number of elements in map  empty() True if map is empty  [] "Subscript search" access operator Map Access functions Purpose begin() Returns iterator pointing to first element end() Returns iterator pointing _after_ last element swap(, ) Swap two elements insert(, ) Insert a new element size() Number of elements in map max_size() Maximum possible number of elements in map empty() True if map is empty [] "Subscript search" access operator  Some Map Access Functions:

 ITERATORS  An Iterator points one element then it can be increased to the next element.  ITERATORS are generic programmes.because they are the interface between containers and algorithms.  Iterators take algorithm as argument, So the container must act to access their element to iterators.There is a possibilty of algorithms that operates different kinds of container.  Iterators are used to iterate a range of objects. if related to iterators and several pre-defined iterators.  Syntax : std::class_name :: iterator name

 TYPES OF ITERATORS

 Algorithms  An algorithm is nothing but single sequential flow of control  Many common algorithms are implemented for queues and maps.  Sorting, searching, inserting, deleting, shuffling, permuting, rotating, reversing, moving, copying, counting, minimum and maximum are some types of algorithms.

 Types of algorithms Mutating Sequence Algorithms copy(), remove(), replace(), fill(), swap() Non Modifying sequence Algorithms find(), count(),search(), mismatch(), equal() Numerical Algorithms accumulate(), partial_sum(), inner_product(), and adjacent_difference()