Day 31 - Examination methods in Deque 1) getFirst( ) : Retrieves, but what doesn't remove the first element. 2) getLast( ) : Retrieves, but does not remove the last element 3) peekFirst( ) : Retrieves, but does not remove the first element or return if empty null if empty. 4) peekLast( ) : Retrieves, but does not remove the last element or returns nullif empty. ● Stack methods: 1) push( ) : Adds an element at the first. 2) pop ( ) : Removes and returns the first element. #Java #Programming #coding #learning #Corejava EchoBrains
Examining Deque Methods in Java
More Relevant Posts
-
How do you solve problems where you need to try every possible combination? This is where Backtracking comes in. In this short video, I explained: - What is backtracking - How it works (try → explore → undo) - Real-world examples like N-Queens and Sudoku - Importance of pruning Backtracking is a powerful approach for solving complex constraint-based problems. Explore structured DSA in Java roadmap + practice: www.quipoin.com #DSA #Java #Programming #Coding #SoftwareEngineering #Algorithms #InterviewPreparation
To view or add a comment, sign in
-
My Learning Journey – Arrays in Java Today, I explored one of the most important concepts in programming – Arrays 💻 🔹 What I learned: ✔️ What is an array and why we use it ✔️ How to declare and initialize arrays ✔️ Accessing elements using index ✔️ Traversing arrays using loops ✔️ Basic programs using arrays 💡 Key takeaway: Arrays help us store multiple values in a single variable, making code more efficient and organized. 📌 Example: int[] numbers = {10, 20, 30, 40}; This small concept is the foundation for advanced topics like Data Structures and Algorithms. 🔥 Step by step, improving every day! #Java #Arrays #CodingJourney #Learning #Programming #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 59 of #100DaysOfCode 📌 Solved: Pascal’s Triangle (LeetCode 118) Today’s problem was all about patterns and building logic step by step. 🔍 Problem Summary: Given an integer numRows, generate the first numRows of Pascal’s Triangle. 💡 Approach: Start with the first row [1] Each row is built using the previous row First and last elements are always 1 Middle elements = sum of two elements from the previous row 🧠 Key Learning: Understanding how previous computations help build the next result is a powerful concept (Dynamic Programming basics). 📈 Complexity: Time: O(n²) Space: O(n²) ✨ Takeaway: Simple problems often hide powerful concepts. Pascal’s Triangle is a great intro to dynamic programming patterns. 🔥 Follow my journey as I solve DSA daily! #DSA #LeetCode #Python #CodingJourney #100DaysOfCode #Programming #Developers
To view or add a comment, sign in
-
-
They wanted the maximum of 5 numbers. The program printed 0. Every number was negative. max = 0 fails when all inputs are negative. Read the first number into max, then loop for the rest. One idea, two bugs avoided. I wrote a beginner guide that covers two classics in one: ✅ Maximum of N numbers — read first into max, loop N−1 times, update if larger (and why not max = 0) ✅ Decimal to binary — divide by 2, collect remainders, reverse. In code: prepend to a string. ✅ Why the "build as number" method loses leading zeros (and why string method is correct) ✅ Full programs: max of N and decimal-to-binary with n=0 handled ✅ Summary, takeaways, and next steps (min, binary→decimal) ~6 min read. Straight to the point. https://lnkd.in/gqJWam9x #Python #Programming #Coding #Beginners #LearnToCode #Maximum #DecimalToBinary #Binary #WhileLoop #Practice #Tech #SoftwareDevelopment #CodingTips
To view or add a comment, sign in
-
-
Day 25 of Programming Today, I focused on solving problems related to index finding and subsequences — two important concepts that sharpen problem-solving and string manipulation skills. 💡 What I learned: How to find the index of a specific character (k) in a string Understanding first occurrence vs last occurrence Exploring subsequences and how they differ from substrings Generating all possible subsequences using recursion ✨ Key Concepts: Indexing helps in efficient searching within strings A subsequence maintains order but doesn’t require continuity Recursive thinking makes complex problems easier to break down 🧠 Problems I solved: Find the first and last index of a character in a string Count how many times a character appears Check if one string is a subsequence of another Generate all subsequences of a given string Find the longest subsequence under given conditions #Programming #CodingJourney #ProblemSolving #Java #Learning
To view or add a comment, sign in
-
-
Day 12 of Consistency 🚀 Today I focused on understanding Time and Space Complexity, which is a fundamental concept in Data Structures and Algorithms. Learned how to analyze the efficiency of an algorithm and why optimizing code is important as input size grows. Understanding complexity helps in writing better and more efficient solutions. Step by step improving my problem-solving mindset. 💻📚 #Day12 #DSA #TimeComplexity #Java #Programming #CodingJourney #LearningInPublic
To view or add a comment, sign in
-
-
If anyone is interested in developing their skills in C (Programming Language), a quick thought based on my experience that might be helpful. 💬 Here are some tips for developing this skill: • Map the Memory: Learn the Stack vs. Heap early. If you don't manage your memory, your OS will, usually by crashing your program. 😅 • Pointers = GPS: Don't fear them. A pointer isn't the "house" (aka the data), it's just the address written on a napkin. • Trust your Tools: Use Valgrind or AddressSanitizer. Don't hunt memory leaks with your eyes, let the tooling do the heavy lifting. Mastering C makes every other language feel like easy mode. Devs, what was your biggest "Aha!" moment with C? 👇 #CProgramming #SoftwareEngineering #Coding #TechTips
To view or add a comment, sign in
-
💻 Built a Diamond Pattern in Java using pure logic and nested loops. While practicing DSA fundamentals, I implemented this pattern by understanding how spaces and stars align in each row. This helped me strengthen my control over loops, conditions, and pattern-based problem solving. 📌 Key Learning: Breaking a complex pattern into smaller logical steps makes it much easier to implement. Consistency in solving such problems is what builds strong programming logic. #Java #DSA #Programming #CodingJourney #ProblemSolving #LogicBuilding #Developers #Learning #100DaysOfCode
To view or add a comment, sign in
-
-
Day 17 - 21 Days of Problem Solving. Today, I explored the importance of Recursion in programming languages. In short, recursion is a technique where a function calls itself. 🤔 There are two major components that play a role here: 👉 Base Case: This tells the recursive function when to stop. If it isn't written, the call stack will fill up. 👉 Recursive Step: This is where you write the logic. I know recursion is used in many real-world projects, such as: 👉 Nested Comments 👉 Folder Structures ...and many more. I will now provide regular updates on what I am learning. #Programming #CodingChallenge #Recursion #DSA #ProblemSolving #TechLearning #WebDevelopment #SoftwareEngineering #CodeNewbie #21DaysOfCode
To view or add a comment, sign in
-
Most people think learning C++ = learning syntax. That’s where they go wrong. C++ isn’t about memorizing keywords or writing fancy code… It’s about thinking better. When I started, I: Jumped between random tutorials Focused too much on syntax Avoided real problems And progress was slow. Everything changed when I shifted to: → Problem solving over syntax → Consistency over motivation → Understanding over memorizing That’s what this carousel is about ⚡ If you're learning C++ (especially for competitive programming), these are the lessons that will actually move you forward. Save this for later. You’ll need it. For structured tutorials & roadmaps: https://www.cpbrains.space Follow for more 🚀 #cpp #competitiveprogramming #coding #developers #programming #dsa #learncoding #softwareengineering #codingjourney #cpbrains
To view or add a comment, sign in
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