Please turn JavaScript on

Code to Architecture

Subscribe to Code to Architecture’s news feed.

Click on “Follow” and decide if you want to get news from Code to Architecture via RSS, as email newsletter, via mobile or on your personal news page.

Subscription to Code to Architecture comes without risk as you can unsubscribe instantly at any time.

You can also filter the feed to your needs via topics and keywords so that you only receive the news from Code to Architecture which you are really interested in. Click on the blue “Filter” button below to get started.

Title: Code to Architecture

Publisher:  sandeepbhardwaj01
Message frequency:  1.1 / day

Message History

This roadmap turns the DSA pattern series into a deliberate reading sequence instead of a loose archive. The goal is not to memorize isolated tricks. The goal is to recognize problem signals quickly, choose the right pattern, and explain the invariant behind the solution in an interview-ready way.

What This Roadmap Covers

The series is organized to move in a practi...


Read full story

Union-Find solves dynamic connectivity problems efficiently. It supports two core operations:

find(x) -> representative of component union(a, b) -> merge components DSU Template

What we are doing actually:

Start with every node as its own parent. find compresses paths so future lookups are faster. union merges two roots and keeps the tree shallo...

Read full story

Choose shortest-path algorithm based on edge weights:

unweighted: BFS non-negative weighted: Dijkstra negative edges: Bellman-Ford (advanced) Pattern 1: BFS Shortest Path (Unweighted)

Problem description: Find the shortest number of edges from src to dst in an unweighted graph.

What we are doing actually:

BFS explores nodes in increasing distan...

Read full story

Graph traversal is foundational for connectivity, reachability, and component analysis. The two primary techniques are DFS and BFS.

Graph Representation List<List<Integer>> g = new ArrayList<>(); for (int i = 0; i < n; i++) g.add(new ArrayList<>()); for (int[] e : edges) { g.get(e[0]).add(e[1]); g.get(e[1]).add(e[0]); // undirected } D...

Read full story

BFS traverses trees level by level. It is ideal for shortest-level decisions and level-grouped output.

Core Idea

Use queue and process nodes by level size.

What we are doing actually:

Put the root in a queue. Snapshot the current queue size before each level. Process exactly that many nodes to keep levels separated. Enqueue children for the next r...

Read full story