Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
10 views
DataStructuresCheatSheet
Cheat sheet of important data structures
Uploaded by
f20220732
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save DataStructuresCheatSheet For Later
Download
Save
Save DataStructuresCheatSheet For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
10 views
DataStructuresCheatSheet
Cheat sheet of important data structures
Uploaded by
f20220732
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save DataStructuresCheatSheet For Later
Carousel Previous
Carousel Next
Save
Save DataStructuresCheatSheet For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 6
Search
Fullscreen
‘12424, 1:56 AM Cheatsheets / C++ for Programmers C++'s Built-In Data vectors In C+4,a vector isa data structure that stores a sequence of elements that can be accested by index. Unlike arrays, vectors can dynamically shrink and grow in ‘The standard
‘extracted only from one end of the container. + push) add an element atthe top of the stack + .pop() remove the element atthe top of the stack Queues are designed to operate ina Fist-In-First-Out context (FIFO), where elements are inserted into one end ‘of the container and extracted from the other. + .push() add an element at the end of the queue, RP + -pop() remove the element atthe front ofthe queue. f empty push (10) ; push (9 push (8 front () <<" "; hitps:www-codecademy,comilearne-pls-plisfor-programmersimodulesicpp-bull-in-date-stucturesicheatshest 26‘12424, 1:58 AM Sets In C++, a sets a data structure that contains a collection ‘of unique elements. Elements of a set are index by thelr ‘own values, oF keys set cannot contain duplicate elements. Once an ‘element has been added to a set, that element cannot be modified. ‘The following methods apply to both unordered_set and set + insert() : add an element to the set + .erase() : removes an element from the set + -count() : check whether an element exists in the + -size() sreturn the size ofthe set. htips:siww-codecasemy comileare:plus-plus-for-programmersimoduleslepp-bl-n-data-stucturesicheatshest “[eodelcademy nsert (11) not inse erase (2); erase (13); // Outputs: primes does not contain 2. contains 2.\n"; mes does not contain 316‘2024, 1:56 AM arrays Arrays in C++ are used to stare a collection of values of 1 the same type. The size of an array is specified when itis declared and cannot change afterward, Use [] and an integer index to access an array element, ng nanesr 3 Keep in mind: array indices start with O, not 1 1 ‘A multidimensional array Is an “array of arrays" and is. declared by adding extra sets of indices to the array Outputs: har 3113 outputs: hitps:www-codecademy,comilearne-pls-plisfor-programmersimodulesicpp-bull-in-date-stucturesicheatshest 416‘12424, 1:58 AM Hash Maps In C+4, a hash map is a data structure that contains a collection of unique elements in the form of key-value Pairs. Elements of a hash map are identified by key values, while the mapped values are the content associated with the keys. Each element of a map or unordered_map is an object of type pair .A pair object has two member variables: + first isthe value of the key + second is the mapped value ‘The following methods apply to both unordered_map and map + insert() : add an element to the map. + .crase() : removes an element from the map. + .count() : check whether an element exists in the map, + -size() return the size of the map. + [] operater: © lithe specified key matches an element in the map, then access the mapped value associated with that key. © Ifthe specified key doesn't match any element in the map, add a new element to the map with that key. “[eodelcademy "Japan"} = 81; uw a new element Thailand") = 66; // Access an element // Outputs: There isn't a code for Belgium elgium")} << "There is a code f i“ “ utputs: Japan 81 https sww-codecasemy comileare:plus-plus-for-programmersimoduleslepp-bll-n-data-stucuresicheatshest 56/ thailand 66 [eodelcademy ee "\n"; cb Print 8 Share v hitps:www-codecademy,comilearne-pls-plisfor-programmersimodulesicpp-bull-in-date-stucturesicheatshest ars
You might also like
C++ For Programmers - C++'s Built-In Data Structures Cheatsheet - Codecademy
PDF
No ratings yet
C++ For Programmers - C++'s Built-In Data Structures Cheatsheet - Codecademy
6 pages
DSA Cheat Sheet
PDF
No ratings yet
DSA Cheat Sheet
24 pages
C++ For Programmers - C++'s Built-In Data Structures Cheatsheet - Codecademy
PDF
No ratings yet
C++ For Programmers - C++'s Built-In Data Structures Cheatsheet - Codecademy
6 pages
C++ STL
PDF
No ratings yet
C++ STL
12 pages
Lecture 6
PDF
No ratings yet
Lecture 6
3 pages
Algo 3
PDF
No ratings yet
Algo 3
8 pages
Week 10_ STLs III
PDF
No ratings yet
Week 10_ STLs III
13 pages
Lecture6 Slides
PDF
No ratings yet
Lecture6 Slides
63 pages
CH 09
PDF
No ratings yet
CH 09
32 pages
C++ STL (Quickest Way To Learn, Even For Absolute Beginners)
PDF
No ratings yet
C++ STL (Quickest Way To Learn, Even For Absolute Beginners)
19 pages
Basic Data Structures: University of Technology and Engineering Vietnam National University Hanoi
PDF
No ratings yet
Basic Data Structures: University of Technology and Engineering Vietnam National University Hanoi
34 pages
C++ STL
PDF
No ratings yet
C++ STL
18 pages
DSA Day 5
PDF
No ratings yet
DSA Day 5
10 pages
OODP unit 5 (1)
PDF
No ratings yet
OODP unit 5 (1)
18 pages
Takeuforward Org C Vector in C STL
PDF
No ratings yet
Takeuforward Org C Vector in C STL
3 pages
DSA TillL21 Merged
PDF
No ratings yet
DSA TillL21 Merged
172 pages
DSA TillL36 Merged
PDF
No ratings yet
DSA TillL36 Merged
368 pages
C++ STL (quickest way to learn, even for absolute beginners)
PDF
No ratings yet
C++ STL (quickest way to learn, even for absolute beginners)
18 pages
STL List Vector
PDF
No ratings yet
STL List Vector
34 pages
STL Concept
PDF
No ratings yet
STL Concept
12 pages
Ace The Basics Final
PDF
No ratings yet
Ace The Basics Final
29 pages
DSA-Chapter-3.1-2024 (1)
PDF
No ratings yet
DSA-Chapter-3.1-2024 (1)
9 pages
Chapter 4 PPT
PDF
No ratings yet
Chapter 4 PPT
30 pages
Data Structure
PDF
No ratings yet
Data Structure
8 pages
STL Unit V
PDF
No ratings yet
STL Unit V
23 pages
Advanced Programming Workshop Day2
PDF
No ratings yet
Advanced Programming Workshop Day2
37 pages
Data_Structures_Guide
PDF
No ratings yet
Data_Structures_Guide
2 pages
What Simple CPP Tricks Should Everyone Know
PDF
No ratings yet
What Simple CPP Tricks Should Everyone Know
3 pages
DATA-STRUCTURES
PDF
No ratings yet
DATA-STRUCTURES
50 pages
Algorithms in The STL Are Procedures That Are Applied
PDF
No ratings yet
Algorithms in The STL Are Procedures That Are Applied
34 pages
Chapter4_Data_Structures_and_Algorithms
PDF
No ratings yet
Chapter4_Data_Structures_and_Algorithms
141 pages
l26STLContainersAssociative (1)
PDF
No ratings yet
l26STLContainersAssociative (1)
15 pages
DSA Interview Cheatsheet
PDF
No ratings yet
DSA Interview Cheatsheet
38 pages
CS106B Notes
PDF
No ratings yet
CS106B Notes
8 pages
DataStructures Cheatsheet Zero To Mastery V1.01
PDF
No ratings yet
DataStructures Cheatsheet Zero To Mastery V1.01
39 pages
STL
PDF
No ratings yet
STL
37 pages
Standard Template Library in C++
PDF
No ratings yet
Standard Template Library in C++
11 pages
Standard Template Library
PDF
No ratings yet
Standard Template Library
38 pages
Lecture Week 1 19022024 110309am
PDF
No ratings yet
Lecture Week 1 19022024 110309am
30 pages
Data Structures Unit 1
PDF
No ratings yet
Data Structures Unit 1
60 pages
C++ VLSQDMA&DA
PDF
No ratings yet
C++ VLSQDMA&DA
33 pages
L15 Maps and Hashes
PDF
No ratings yet
L15 Maps and Hashes
41 pages
DS
PDF
No ratings yet
DS
25 pages
STLs
PDF
No ratings yet
STLs
7 pages
Lecture14 Handouts
PDF
No ratings yet
Lecture14 Handouts
69 pages
dsac
PDF
No ratings yet
dsac
38 pages
Data Structures & Algorithms in C
PDF
No ratings yet
Data Structures & Algorithms in C
17 pages
Dsa MK Lect1
PDF
No ratings yet
Dsa MK Lect1
109 pages
Introduction
PDF
No ratings yet
Introduction
51 pages
DSA
PDF
No ratings yet
DSA
5 pages
Senior Five Mce MPC Notes Data Structure and Algorithms
PDF
No ratings yet
Senior Five Mce MPC Notes Data Structure and Algorithms
122 pages
Unit-1
PDF
No ratings yet
Unit-1
32 pages
03 Set Map-660-16913454342052
PDF
No ratings yet
03 Set Map-660-16913454342052
14 pages
Data Structures in C
PDF
No ratings yet
Data Structures in C
11 pages
Lesson One-Data Structures
PDF
No ratings yet
Lesson One-Data Structures
6 pages
ee3490e chapter 4+5
PDF
No ratings yet
ee3490e chapter 4+5
38 pages
Intro - To - Data Structure - Lec - 1
PDF
No ratings yet
Intro - To - Data Structure - Lec - 1
29 pages