Underlying data structures used in STL:- It explicitly maps: vector → dynamic array array → static array deque → segmented array list → doubly linked list forward_list → singly linked list map/set family → red-black tree unordered_map → hash table priority_queue → heap #cpp #softwareengineering #embedded #systemdesign #designpatterns #programming #cleanarchitecture #cplusplus #embeddedsoftware #coding
STL Data Structures in C++
More Relevant Posts
-
💻In this new Ansys Innovation Space blog, we’ll take a closer look at one of the key improvements in Scade One 2026 R1: the Swan code generator. This tool converts Swan models into efficient, portable C code, and with the latest release, it’s now even better at optimizing performance of the generated code. Read more at: https://bit.ly/4c5MUeC #programmer #programming #modelbaseddedign
To view or add a comment, sign in
-
Flatten Binary tree to linked list Approach: Do kind of post-order traversal ( right -> left -> root ) maintain a previous node go right (recursively) go left (recursively) make root->right point to previous and root->left point to null and update previous to root TC: O(N) SC: O(N) - recursive stack #DSA #programming #coding #buildinpublic #Technology #ProblemSolving #LeetCode #LearnInPublic #Consistency
To view or add a comment, sign in
-
-
Subtree of another tree Approach: If subRoot is null - return true If root is null - return false If values match - check isIdentical(root, subRoot) If identical - return true Else - check left and right: isSubtree(root.left, subRoot) isSubtree(root.right, subRoot) Return true if found anywhere, otherwise false TC: O(N*M) -- n =no. of nodes in root, m = no. nodes in subRoot (worst case) SC: O(h) -- height of tree ( O(N) -- skewed tree || O(logN) -- balanced tree) #coding #programming #DSA #Consistency #Leetcode #CodingJourney
To view or add a comment, sign in
-
-
C Programming: Array Sum Calculator. #CProgramming #Programming #Coding #DataStructures #SoftwareEngineering #LearningJourney #include<Stdio.h> int main() { int size; printf("Enter the size : "); scanf("%d",&size); int arr[size]; for(int i=0; i<size; i++) { printf("a[%d] : ",i); scanf("%d",&arr[i]); } int sum=0; for(int i=0; i<size; i++) { sum=sum+arr[i]; } printf("Sum : %d\n",sum); return 0; }
To view or add a comment, sign in
-
LCA - Lowest Common Ancestor of binary tree Approach: If current node is null, return null If current node is p or q, return current node Recursively search left and right If both sides return non-null → current node is LCA Otherwise → return the non-null side TC = O(n) SC = O(h) - depends on tree height (recursion stack) O(logn) - balanced tree O(n) - skewed tree #dsa #leetcode #consistency #coding #programming
To view or add a comment, sign in
-
-
Invert Binary tree Approach: check if node is null or not if null return null swap left node and right ( not value complete node ) go to left (recursively) go to right (recursively) return node TC: O(N) SC:O(N)- recursive stack #DSA #programming #coding #problemSolving
To view or add a comment, sign in
-
-
𝐓𝐞𝐜𝐡 𝐓𝐢𝐩𝐬 𝐖𝐞𝐞𝐤 3 : 𝐑𝐞𝐦𝐨𝐯𝐞 𝐝𝐮𝐩𝐥𝐢𝐜𝐚𝐭𝐞𝐬 𝐢𝐧𝐭𝐞𝐧𝐭𝐢𝐨𝐧𝐚𝐥𝐥𝐲 — 𝐧𝐨𝐭 𝐛𝐥𝐢𝐧𝐝𝐥𝐲. Using “Remove Duplicates” without selecting the right columns can delete valid records. Always choose the specific columns that define a true duplicate. 𝑾𝒓𝒐𝒏𝒈 𝒄𝒍𝒆𝒂𝒏𝒖𝒑 = 𝒍𝒐𝒔𝒕 𝒅𝒂𝒕𝒂. 𝘍𝘰𝘭𝘭𝘰𝘸 𝘮𝘦 𝘧𝘰𝘳 𝘮𝘰𝘳𝘦 𝘴𝘶𝘤𝘩 𝘞𝘦𝘦𝘬𝘭𝘺 𝘛𝘦𝘤𝘩 𝘛𝘪𝘱𝘴 𝘤𝘰𝘯𝘵𝘦𝘯𝘵 ! #DataTips #TechSeries #AnalystLife #LearnData #Programming #SoftwareEngineering #DataStrategy #DataDriven #PowerBI #PowerBITips #OmJadhav
To view or add a comment, sign in
-
Binary tree right side view Approach: - Keep a level variable - If level == result.size(), add current node (first node of that level) - Traverse right first, then left Time: O(n) Space: O(h) (worst: O(n), best: O(log n)) #Algorithms #DSA #LeetCode #coding #Programming
To view or add a comment, sign in
-
-
🚀 Turning Logic into Art with C++ Today, I worked on building a pattern generation program using C++ and recursion — and the result was something visually satisfying: a perfectly aligned diamond/star pattern rendered in the console. What looks like a simple pattern actually involves: ✔️ Understanding recursion deeply ✔️ Managing multiple variables efficiently ✔️ Controlling flow for symmetrical design ✔️ Writing clean and optimized logic This small project reminded me that programming is not just about solving problems — it’s also about creativity and precision. Even a console output can feel like art when logic is applied the right way. 💡 Key takeaway: Strong fundamentals in Data Structures and recursion can help you build elegant and efficient solutions, even for problems that seem simple at first glance. Always learning. Always building. #Cplusplus #Programming #DSA #Recursion #CodingJourney #SoftwareDevelopment #ProblemSolving
To view or add a comment, sign in
-
-
Solved LeetCode 151: Reverse Words in a String Today, I worked on reversing the order of words in a string while handling extra spaces efficiently. I learned how to: Remove leading, trailing, and multiple spaces Extract words correctly Reverse their order using clean logic and STL I implemented an optimized solution with: Time Complexity: O(n) Space Complexity: O(n) This problem helped me improve my understanding of string manipulation, edge case handling, and clean coding practices https://lnkd.in/getBKFiE GitHub Repo: https://lnkd.in/gg4daDpn #day18 #DSA #Cpp #LeetCode #Coding #Programming #Learning #ProblemSolving #Strings
To view or add a comment, sign in
-
More from this author
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development