#dfs algorithm
Explore tagged Tumblr posts
canary-song · 3 months ago
Text
the epic highs and lows of coding with C
1 note · View note
dylawas-reblogs · 2 years ago
Text
Dear r*df*ms (I'm sorry for censoring if you have this word blacklisted, I don't want them to find this post):
Putting "trans ally" in your tags alongside "r*dical f*minism" does not negate the "r*df*m" part.
1 note · View note
justnshalom · 2 years ago
Text
Connected Sum Solution for Hackerrank
Problem Statement Given a graph with n nodes and m edges, we need to find the sum of the sizes of connected components in the graph. Each connected component is a subgraph in which every pair of nodes is connected by a path. For example, consider the following graph: 1 - 2 | 3 - 4 | 5 - 6 In this graph, there are 3 connected components: {1, 2}, {3, 4}, and {5, 6}. The sizes of these connected…
Tumblr media
View On WordPress
0 notes
stargazerbibi · 5 months ago
Text
Tumblr media Tumblr media
[ 16th january, 2025 • 130/152 days ]
-> studied ASA (topics: heaps, greedy algorithms, activity selection problems, Huffman codes, DFS, topological sorts, SCC, BFS + invariants)
-> more Anna Karenina, by Leo Tolstoy (way more enjoyable than i thought it was going to be,, perhaps i'm being insenstitive, but i'm laughing so much at The Drama)
37 notes · View notes
bitfreak · 1 month ago
Text
Most Asked Coding Questions in Placements
Getting ready for placements? Whether you're aiming for a service-based firm or a top-tier product company, you must brush up on your coding fundamentals and problem-solving skills. 🚀
Tumblr media
Here are the go-to topics recruiters always test:
Arrays & Strings – Duplicates, palindromes, reversing arrays, maximum subarray sum.
Linked Lists – Reversing a list, detecting cycles, merging two sorted lists.
Sorting & Searching – Implementing sorting algorithms, using binary search creatively.
Recursion & Backtracking – Generating permutations/combinations, solving Sudoku.
Dynamic Programming – Longest Common Subsequence, Knapsack, and similar problems.
Trees & Graphs – Tree/graph traversals, finding shortest paths, DFS/BFS.
Stacks & Queues – Valid parentheses, implementing queues using stacks, and vice versa.
✨ Want a full list of the top coding questions companies love to ask? Check out this solid guide: Most Asked Coding Questions in Placements - https://prepinsta.com/interview-preparation/technical-interview-questions/most-asked-coding-questions-in-placements/
Level up your prep and go ace that interview. 💪💻
3 notes · View notes
gobliiine · 1 month ago
Text
Hey tumblr why are you suggesting r*df*m content to me 🙃
Anyways stopping in to say trans women are women so that hopefully whatever algorithm tumblr might be using to suggest that shit to me will fuck off 🙃🙃
2 notes · View notes
simerjeet · 6 months ago
Text
Mastering Data Structures: A Comprehensive Course for Beginners
Data structures are one of the foundational concepts in computer science and software development. Mastering data structures is essential for anyone looking to pursue a career in programming, software engineering, or computer science. This article will explore the importance of a Data Structure Course, what it covers, and how it can help you excel in coding challenges and interviews.
1. What Is a Data Structure Course?
A Data Structure Course teaches students about the various ways data can be organized, stored, and manipulated efficiently. These structures are crucial for solving complex problems and optimizing the performance of applications. The course generally covers theoretical concepts along with practical applications using programming languages like C++, Java, or Python.
By the end of the course, students will gain proficiency in selecting the right data structure for different problem types, improving their problem-solving abilities.
2. Why Take a Data Structure Course?
Learning data structures is vital for both beginners and experienced developers. Here are some key reasons to enroll in a Data Structure Course:
a) Essential for Coding Interviews
Companies like Google, Amazon, and Facebook focus heavily on data structures in their coding interviews. A solid understanding of data structures is essential to pass these interviews successfully. Employers assess your problem-solving skills, and your knowledge of data structures can set you apart from other candidates.
b) Improves Problem-Solving Skills
With the right data structure knowledge, you can solve real-world problems more efficiently. A well-designed data structure leads to faster algorithms, which is critical when handling large datasets or working on performance-sensitive applications.
c) Boosts Programming Competency
A good grasp of data structures makes coding more intuitive. Whether you are developing an app, building a website, or working on software tools, understanding how to work with different data structures will help you write clean and efficient code.
3. Key Topics Covered in a Data Structure Course
A Data Structure Course typically spans a range of topics designed to teach students how to use and implement different structures. Below are some key topics you will encounter:
a) Arrays and Linked Lists
Arrays are one of the most basic data structures. A Data Structure Course will teach you how to use arrays for storing and accessing data in contiguous memory locations. Linked lists, on the other hand, involve nodes that hold data and pointers to the next node. Students will learn the differences, advantages, and disadvantages of both structures.
b) Stacks and Queues
Stacks and queues are fundamental data structures used to store and retrieve data in a specific order. A Data Structure Course will cover the LIFO (Last In, First Out) principle for stacks and FIFO (First In, First Out) for queues, explaining their use in various algorithms and applications like web browsers and task scheduling.
c) Trees and Graphs
Trees and graphs are hierarchical structures used in organizing data. A Data Structure Course teaches how trees, such as binary trees, binary search trees (BST), and AVL trees, are used in organizing hierarchical data. Graphs are important for representing relationships between entities, such as in social networks, and are used in algorithms like Dijkstra's and BFS/DFS.
d) Hashing
Hashing is a technique used to convert a given key into an index in an array. A Data Structure Course will cover hash tables, hash maps, and collision resolution techniques, which are crucial for fast data retrieval and manipulation.
e) Sorting and Searching Algorithms
Sorting and searching are essential operations for working with data. A Data Structure Course provides a detailed study of algorithms like quicksort, merge sort, and binary search. Understanding these algorithms and how they interact with data structures can help you optimize solutions to various problems.
4. Practical Benefits of Enrolling in a Data Structure Course
a) Hands-on Experience
A Data Structure Course typically includes plenty of coding exercises, allowing students to implement data structures and algorithms from scratch. This hands-on experience is invaluable when applying concepts to real-world problems.
b) Critical Thinking and Efficiency
Data structures are all about optimizing efficiency. By learning the most effective ways to store and manipulate data, students improve their critical thinking skills, which are essential in programming. Selecting the right data structure for a problem can drastically reduce time and space complexity.
c) Better Understanding of Memory Management
Understanding how data is stored and accessed in memory is crucial for writing efficient code. A Data Structure Course will help you gain insights into memory management, pointers, and references, which are important concepts, especially in languages like C and C++.
5. Best Programming Languages for Data Structure Courses
While many programming languages can be used to teach data structures, some are particularly well-suited due to their memory management capabilities and ease of implementation. Some popular programming languages used in Data Structure Courses include:
C++: Offers low-level memory management and is perfect for teaching data structures.
Java: Widely used for teaching object-oriented principles and offers a rich set of libraries for implementing data structures.
Python: Known for its simplicity and ease of use, Python is great for beginners, though it may not offer the same level of control over memory as C++.
6. How to Choose the Right Data Structure Course?
Selecting the right Data Structure Course depends on several factors such as your learning goals, background, and preferred learning style. Consider the following when choosing:
a) Course Content and Curriculum
Make sure the course covers the topics you are interested in and aligns with your learning objectives. A comprehensive Data Structure Course should provide a balance between theory and practical coding exercises.
b) Instructor Expertise
Look for courses taught by experienced instructors who have a solid background in computer science and software development.
c) Course Reviews and Ratings
Reviews and ratings from other students can provide valuable insights into the course’s quality and how well it prepares you for real-world applications.
7. Conclusion: Unlock Your Coding Potential with a Data Structure Course
In conclusion, a Data Structure Course is an essential investment for anyone serious about pursuing a career in software development or computer science. It equips you with the tools and skills to optimize your code, solve problems more efficiently, and excel in technical interviews. Whether you're a beginner or looking to strengthen your existing knowledge, a well-structured course can help you unlock your full coding potential.
By mastering data structures, you are not only preparing for interviews but also becoming a better programmer who can tackle complex challenges with ease.
3 notes · View notes
snaildotexe · 2 years ago
Text
Software Technical Interview Review List
Data Structures
Arrays (and Java List vs ArrayList)
String
Stack
Queue
LinkedList
Algorithms
Sorting (Bubblesort, Mergesort, Quicksort)
Recursion & Backtracking
Linear and Binary Search
String/Array algos
Tree traversal
Dynamic Programming
Graph algos (DFS, BFS, Dijksta's and Kruskals)
OOP fundamentals
Polymorphism
Inheritance
Encapsulation
Data abstraction
SOLID and GRASP
Explanations & example questions:
Strings and Arrays [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 ]
Stacks and Queues [ 1 | 2 ]
LinkedList [ 1 | 2 ]
Sorting & searching [ 1 | 2 | 3 | 4 | 5 | 6 | 7 ]
Recursion and Backtracking [ 1 | 2 | 3 | 4 ]
Dynamic Programming [ 1 | 2 | 3 | 4]
Graphs [ 1 | 2 | 3 ]
Tree [ 1 | 2 ]
General DS&A info and questions [ 1 | 2 | 3 | 4 | 5 ]
OOP review & questions [ 1 | 2 | 3 ]
20 notes · View notes
mrcatfishing · 1 year ago
Text
Tagged by @fipindustries to post my playlist, and I much like her do not curate my playlists and instead listen to stuff semi-algorithmically. So here's the first 10 songs of my Supermix.
Life of Adventure, from Dwarf Fortress Adventure Mode, by Dabu and Simon Swerwer. I tend to prefer videogame soundtracks when writing, as any kind of lyrics interrupt my flow of thought severely. The acoustic guitar of the classic Dwarf Fortress soundtrack is beautifully accompanied by a full orchestration that blocks out all distraction.
Beautiful Mind, by Tom Cardy & Brian David Gilbert. When I do listen to music with lyrics, I much prefer them to be narrative centred rather than emotionally centred. Tom Cardy is one of the best for this style of comedic-narrative music, and BDG is another favourite of mine for his podcast Let's Make a Music, which sadly only uploads their songs to Bandcamp, making it hard to integrate into my playlists.
HEART CONNECT, by Cute Girls Doing Cute Things. Mindless electronic music makes up another solid portion of music for when I need to focus on something I'm working on, though this kind of harsher pumping music is usually for physical activities, rather than mental ones. While I recognise this song very well, before right now I knew neither its name nor the artist.
Strike The Earth!, from Dwarf Fortress, by Dabu and Simon Swerwer. Another DF song, the entire OST really strikes a delicate balance hitting all of my preferences: Bardcore, Acoustic Instruments, and Videogame OSTs.
Soldier, Poet, King, bardcore cover by Hildegard von Blingin'. I said I was a fool for Bardcore, and that absolutely includes covers by the wonderful Hildegard von Blingin'. Seeing that she got to do a song for the latest Crusader Kings expansion was a delightful surprise to be sure.
The World Revolving, cover by NRMN, Blood Code & GameChops. Feel free to put me in the penis box, but I absolutely adore Undertale music. I also love the electronic covers of GameChops and QUMU, which is the latest form my long standing OCRemix obession from a decade ago has taken.
To Hell and Back, by Sabaton. On the far end from the narrative music of Tom Cardy, Sabaton and other power-metal bands like Dragonforce make up songs that I listen to during the morning commute. These lyrical songs also have their fair share of narrative focus, but I'm really hear for the deafening volume to activate my brain and work up my adrenaline.
Bones in the Ocean (Remixed), by The Longest Johns. These shanties and folk songs soothe me to sleep. When I need to hear something with just enough words to latch my mind onto a rhythm without spinning my brain in circles or waking it up with adrenaline, I pop on some Longest Johns or Great Big Sea, and let myself drift away.
The Bannered Mare, from Skyrim, by Jeremy Soule. The Skyrim OST has a special kind of nostalgia, pulling me back over a decade, to playing the original Xbox 360 release on a tiny CRT television that cut off the top and bottom of the screen. I didn't know this of course, so it was only months into my playing the game that I learned most people saw a compass at the top and their healthbar along the bottom.
Unreal, by Kensabeast & GlitchxCity. This is the kind of music I listen to when I need to both focus and relax. Perfect for painting or sculpting, I can pop on some soothing albums by QUMU or GlitchxCity and just zone out.
I think that gives a reasonable overview of my music taste without terribly exposing myself to the mortifying ordeal of being known. I'll tag the last few mutuals in my activity feed, and anyone else interested can feel free to give this a shot too. @theothin @obbsessivebookworm @therandominternetperson
5 notes · View notes
girlwithmanyproblems · 21 days ago
Text
June 2025
My Goals & Deadlines
Job Search: Secure ≥ 7 interviews by June 30th.
Projects:
Complete Multi-Agent Systems Project by June 15th.
Complete AWS RAG Pipeline Project by June 30th.
DSA & LeetCode (NeetCode Roadmap - FULL Completion):
Week 1 (June 1-7): Cover Stacks (all easy/medium), Arrays & Hashing, Two Pointers.
Week 2 (June 8-15): Cover Linked Lists (all easy LeetCode questions).
Week 3 (June 16-22): Cover Recursion (all easy Leetcode questions).
Week 4 (June 23-30): Cover DFS & BFS (all easy LeetCode questions).
Participate in ≥ 1 LeetCode contest each week.
Participate in ≥ 1 Codeforces contest each week.
Books:
Finish "AI Agents in Action" by June 15th.
Finish "Algorithms" by June 30th.
1 note · View note
govindhtech · 1 month ago
Text
4DBInfer: A Tool for Graph-Based Prediction in Databases
Tumblr media
4DBInfer
A database-based graph-centric predictive modelling benchmark.
4DBInfer enables model comparison, prediction tasks, database-to-graph extraction, and graph-based predictive architectures.
4DBInfer, an extensive open-source benchmarking toolbox, focusses on graph-centric predictive modelling on Relational Databases (RDBs). Shanghai Lablet of Amazon built it to meet the major gap in well-established, publically accessible RDB standards for training and assessment.
As computer vision and natural language processing advance, predictive machine learning models using RDBs lag behind. The lack of public RDB benchmarks contributes to this gap. Single-table or graph datasets from preprocessed relational data often form the basis for RDB prediction models. RDBs' natural multi-table structure and properties are not fully represented by these methods, which may limit model performance.
4DBInfer addresses this with a 4D exploring framework. The 4-D design of RDB predictive analytics allows for deep exploration of the model design space and meticulous comparison of baseline models along these four critical dimensions:
4DBInfer includes RDB benchmarks from social networks, advertising, and e-commerce. Temporal evolution, schema complexity, and scale (billions of rows) vary among these datasets.
For every dataset, 4DBInfer finds realistic prediction tasks, such as estimating missing cell values.
Techniques for RDB-to-graph extraction: The program supports many approaches to retain the rich tabular information of big RDBs' structured data while transforming it into graph representations. The Row2Node function turns every table row into a graph node with foreign-key edges, whereas the Row2N/E method turns some rows into edges only to capture more sophisticated relational patterns. Additionally, “dummy tables” improve graph connectivity. According to the text, these algorithms subsample well.
FourDBInfer implements several resilient baseline structures for graph-based learning. These cover early and late feature-fusion paradigms. Deep Feature Synthesis (DFS) models collect tabular data from the graph before applying typical machine learning predictors, while Graph Neural Networks (GNNs) train node embeddings using relational message passing. These trainable models output subgraph-based predictions with well-matched inductive biases.
Comprehensive 4DBInfer tests yielded many noteworthy findings:
Graph-based models that use the complete multi-table RDB structure usually perform better than single-table or table joining models. This shows the value of RDB relational data.
The RDB-to-graph extraction strategy considerably affects model performance, emphasising the importance of design space experimentation.
GNNs and other early feature fusion graph models perform better than late-fusion models. Late-fusion models can compete, especially with computing limits.
Model performance depends on the job and dataset, underscoring the need for many benchmarks to provide correct findings.
The results suggest a future research topic: the tabular-graph machine learning paradigm nexus may yield the best solutions.
4DBInfer provides a consistent, open-sourced framework for the community to develop creative approaches that accelerate relational data prediction research. The source code of 4DBInfer is public.
0 notes
codingprolab · 2 months ago
Text
CSE 374: Algorithms I Coding Homework #4 BFS/DFS
Given two words (beginWord and endWord), and a dictionary’s word list, find all shortest transformation sequence(s) from beginWord to endWord, such that: 1. Only one letter can be changed at a time 2. Each transformed word must exist in the word list. Note that beginWord is not a transformed word. Note: 1. Return an empty list if there is no such transformation sequence. 2. All words have the…
0 notes
leetcode1 · 2 months ago
Video
youtube
LEETCODE PROBLEMS 1-100 . C++ SOLUTIONS
Arrays and Two Pointers   1. Two Sum – Use hashmap to find complement in one pass.   26. Remove Duplicates from Sorted Array – Use two pointers to overwrite duplicates.   27. Remove Element – Shift non-target values to front with a write pointer.   80. Remove Duplicates II – Like #26 but allow at most two duplicates.   88. Merge Sorted Array – Merge in-place from the end using two pointers.   283. Move Zeroes – Shift non-zero values forward; fill the rest with zeros.
Sliding Window   3. Longest Substring Without Repeating Characters – Use hashmap and sliding window.   76. Minimum Window Substring – Track char frequency with two maps and a moving window.
Binary Search and Sorted Arrays   33. Search in Rotated Sorted Array – Modified binary search with pivot logic.   34. Find First and Last Position of Element – Binary search for left and right bounds.   35. Search Insert Position – Standard binary search for target or insertion point.   74. Search a 2D Matrix – Binary search treating matrix as a flat array.   81. Search in Rotated Sorted Array II – Extend #33 to handle duplicates.
Subarray Sums and Prefix Logic   53. Maximum Subarray – Kadane’s algorithm to track max current sum.   121. Best Time to Buy and Sell Stock – Track min price and update max profit.
Linked Lists   2. Add Two Numbers – Traverse two lists and simulate digit-by-digit addition.   19. Remove N-th Node From End – Use two pointers with a gap of n.   21. Merge Two Sorted Lists – Recursively or iteratively merge nodes.   23. Merge k Sorted Lists – Use min heap or divide-and-conquer merges.   24. Swap Nodes in Pairs – Recursively swap adjacent nodes.   25. Reverse Nodes in k-Group – Reverse sublists of size k using recursion.   61. Rotate List – Use length and modulo to rotate and relink.   82. Remove Duplicates II – Use dummy head and skip duplicates.   83. Remove Duplicates I – Traverse and skip repeated values.   86. Partition List – Create two lists based on x and connect them.
Stack   20. Valid Parentheses – Use stack to match open and close brackets.   84. Largest Rectangle in Histogram – Use monotonic stack to calculate max area.
Binary Trees   94. Binary Tree Inorder Traversal – DFS or use stack for in-order traversal.   98. Validate Binary Search Tree – Check value ranges recursively.   100. Same Tree – Compare values and structure recursively.   101. Symmetric Tree – Recursively compare mirrored subtrees.   102. Binary Tree Level Order Traversal – Use queue for BFS.   103. Binary Tree Zigzag Level Order – Modify BFS to alternate direction.   104. Maximum Depth of Binary Tree – DFS recursion to track max depth.   105. Build Tree from Preorder and Inorder – Recursively divide arrays.   106. Build Tree from Inorder and Postorder – Reverse of #105.   110. Balanced Binary Tree – DFS checking subtree heights, return early if unbalanced.
Backtracking   17. Letter Combinations of Phone Number – Map digits to letters and recurse.   22. Generate Parentheses – Use counts of open and close to generate valid strings.   39. Combination Sum – Use DFS to explore sum paths.   40. Combination Sum II – Sort and skip duplicates during recursion.   46. Permutations – Swap elements and recurse.   47. Permutations II – Like #46 but sort and skip duplicate values.   77. Combinations – DFS to select combinations of size k.   78. Subsets – Backtrack by including or excluding elements.   90. Subsets II – Sort and skip duplicates during subset generation.
Dynamic Programming   70. Climbing Stairs – DP similar to Fibonacci sequence.   198. House Robber – Track max value including or excluding current house.
Math and Bit Manipulation   136. Single Number – XOR all values to isolate the single one.   169. Majority Element – Use Boyer-Moore voting algorithm.
Hashing and Frequency Maps   49. Group Anagrams – Sort characters and group in hashmap.   128. Longest Consecutive Sequence – Use set to expand sequences.   242. Valid Anagram – Count characters using map or array.
Matrix and Miscellaneous   11. Container With Most Water – Two pointers moving inward.   42. Trapping Rain Water – Track left and right max heights with two pointers.   54. Spiral Matrix – Traverse matrix layer by layer.   73. Set Matrix Zeroes – Use first row and column as markers.
This version is 4446 characters long. Let me know if you want any part turned into code templates, tables, or formatted for PDF or Markdown.
0 notes
ankitcodinghub · 3 months ago
Text
CSC6013 - Worksheet for Week 4 Solved
DFS – Breadth First Search using the brute force algorithm as seem in class Consider the graph below: 1) Represent this graph using an adjacency list. Arrange the neighbors of each vertex in alphabetical order. – list the triplets for this graph in the form (A, B, 1), where there is a edge from vertex A to vertex B; – Note that this graph is directed, unlike the one presented in class. • (A, E,…
0 notes
tpointtech · 3 months ago
Text
0 notes
tccicomputercoaching · 3 months ago
Text
What is the concept of DSA?
Tumblr media
Meaning of DSA
In today's technology-driven world, understanding what is the concept of DSA (Data Structures and Algorithms) is crucial for anyone in computer science and software development. Whether you're a beginner or an experienced programmer, mastering DSA helps in writing efficient and optimized programs. At TCCI-Tririd Computer Coaching Institute, our experts guide students in grasping DSA concepts and enhancing their problem-solving skills.
Understand DSA: The Programming Foundation
Data Structures and Algorithms can be considered the pillar of programming. It organizes and manages data so that searching, sorting, or manipulating it becomes more accessible and more rapid.
Why is DSA Needed?
Optimized Coding: Well-structured algorithms make a program run faster.
Interview Preparation: Tech companies focus a lot on DSA in their job interviews.
Problem-Solving Efficiency: DSA improves logical and coding skills.
Competitive Programming: Good DSA knowledge helps in solving very complicated coding problems quickly.
Components of DSA
Data Structures: These are ways in which data can be organized and stored. Some critical would include:
Arrays – Data is stored in a fixed-size.
Linked Lists – Flexible storage through dynamic memory allocation.
Stacks & Queues – LIFO & FIFO data handling techniques.
Trees & Graphs – Grouping data hierarchically or based on a network.
Hashtables – Using a key-value pair for fast access to data.
Algorithms: It is a stepwise procedure for solving problems. They can be of several types, including:
Sorting Algorithms (Bubble Sort, Merge Sort, Quick Sort)
Searching Algorithms (Binary Search, Linear Search)
Graph Algorithms (Dijkstra's Algorithm, BFS, DFS)
Dynamic Programming (Fibonacci Series, Knapsack Problem)
Learn DSA with TCCI
We, the TCCI-Tririd Computer Coaching Institute, give in-depth knowledge of Data Structures and Algorithms by coding practice. Our expert faculty ensure the students get all necessary practical knowledge as well as confidence in solving real-life programmings.
Join TCCI for your first step towards DSA learning now and better your programming skills!
Let's join together and be coding pros! 🚀
Location: Bopal & Iskon-Ambli Ahmedabad, Gujarat
Call now on +91 9825618292
Get information from: https://tccicomputercoaching.wordpress.com/
0 notes