SShortSingh.
Back to feed

Graph Theory in C#: BFS, DFS, and Real-World Problem Solving Explained

0
·1 views

A technical tutorial published on DEV Community demonstrates how to apply graph theory concepts in C# to solve practical problems such as resolving nested role-based permissions. The article covers core vocabulary, including the distinction between directed and undirected graphs, which the author identifies as the most common source of silent bugs in hand-written graph code. It walks through implementing a generic Graph class using a dictionary of HashSets to prevent duplicate edges and ensure efficient traversal. Breadth-first search (BFS) and depth-first search (DFS) are both explained with working C# code, highlighting key implementation details like when to mark nodes as visited. The guide also addresses finding all connected components by iterating over unvisited nodes and launching fresh traversals from each.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingHacker News ·

TreasuryDirect to Require ID.me for Account Login

TreasuryDirect, the U.S. government platform for purchasing savings bonds, is transitioning to ID.me as its new mandatory login verification system. Users will need to create or link an ID.me account to continue accessing TreasuryDirect services. The change represents a shift toward identity verification technology for securing access to federal financial accounts. Account holders are being advised to prepare for the transition ahead of the switchover deadline.

0
ProgrammingDEV Community ·

Developer builds browser-only dev tools after realizing he kept leaking production JWTs

A developer has launched a free, browser-based toolkit at devtools-hub-sigma.vercel.app after recognizing a personal habit of pasting sensitive data, including production JWTs, into random online tools. The site offers eight utilities — including a JWT decoder, JSON formatter, Base64 encoder, and cron parser — that run entirely client-side with no backend involved. The developer noted that most free online tools unnecessarily send user-pasted data to remote servers, even though browser APIs like atob() and JSON.parse can handle the work locally. Because no server is in the processing path, there is nothing to log, offering a stronger privacy guarantee than a policy-based promise. The project was built using Next.js, TypeScript, Tailwind, and shadcn/ui, and is deployed on Vercel.

0
ProgrammingDEV Community ·

Developer Builds ArthMitra, a Hindi-English Voice Agent for Financial Literacy in India

A developer has created ArthMitra, a voice-first financial literacy assistant called Anisha, designed specifically for Indian users who can interact in Hindi, Hinglish, or other native languages. The agent was built during the 10 Days of Voice Agents — VoiceForBharat Edition, using Deepgram for speech recognition, Groq's Llama 3.3 as the language model, Murf Falcon for text-to-speech, and LiveKit for real-time audio streaming. Key features include tools that fetch live currency exchange rates, check eligibility for government schemes like PMJDY and Mudra, and retrieve current bank interest rates from a local dataset to prevent AI hallucinations. The developer addressed code-mixed pronunciation issues by enforcing native Devanagari script in the system prompt, ensuring accurate text-to-speech output. The project is open-source, with setup instructions and code available on GitHub for others to build similar voice agents.

0
ProgrammingDEV Community ·

Developer Builds Hindi-Speaking AI Farm Advisor for Indian Farmers in 10 Days

A developer built 'Samar', an AI-powered agricultural voice assistant designed to help Indian farmers get real-time farming advice in Hindi and English over the phone. The system was created as part of the '10 Days of Voice Agents — VoiceForBharat Edition' challenge by Murf AI. Samar uses Deepgram for speech recognition, Google Gemini as its language model, and Murf Falcon text-to-speech to deliver natural-sounding Hindi responses in Devanagari script. The assistant can provide weather forecasts, crop market prices, and pest diagnosis, while also supporting human escalation and call analytics dashboards. The developer plans future improvements including regional language support for Tamil and Telugu, WhatsApp integration, and an offline mode for low-connectivity areas.

Graph Theory in C#: BFS, DFS, and Real-World Problem Solving Explained · ShortSingh