Tagged articles
16 articles
Page 1 of 1
Sohu Tech Products
Sohu Tech Products
May 31, 2023 · Fundamentals

Graph Theory Basics: Concepts, Storage, and Traversal (DFS & BFS)

This article introduces the basic concepts of graphs, including vertices, edges, directed and undirected types, explains common storage methods such as adjacency matrices and adjacency lists with examples, and demonstrates graph traversal techniques like depth‑first and breadth‑first search using Java code.

Adjacency ListBFSDFS
0 likes · 6 min read
Graph Theory Basics: Concepts, Storage, and Traversal (DFS & BFS)
NiuNiu MaTe
NiuNiu MaTe
May 11, 2021 · Fundamentals

Can a Frog Jump Across All Platforms? Jump Game Solutions with DFS, DP, Greedy

Given an array where each element indicates the maximum jump length from that position, this article explores multiple strategies—depth‑first search, dynamic programming, greedy, and reverse‑tracking—to determine whether the frog can reach the last board, comparing their efficiency and implementation details.

DFSalgorithmdynamic programming
0 likes · 7 min read
Can a Frog Jump Across All Platforms? Jump Game Solutions with DFS, DP, Greedy
JavaEdge
JavaEdge
Jan 2, 2020 · Fundamentals

How to Compute the Maximum Path Sum in a Binary Tree (C Solution)

This article explains the binary‑tree maximum path sum problem, provides example inputs and outputs, analyzes three possible path configurations, and presents both a brute‑force and an optimized depth‑first search implementation in C.

CDFSalgorithm
0 likes · 5 min read
How to Compute the Maximum Path Sum in a Binary Tree (C Solution)
FunTester
FunTester
Aug 26, 2019 · Fundamentals

How to Check If a Binary Tree Is Symmetric in O(n) Time

This article explains the symmetric‑tree problem, outlines a depth‑first recursive strategy with base‑case checks, demonstrates short‑circuit evaluation, analyzes time complexity, and provides a complete Java implementation that determines tree symmetry in linear time.

DFSJavaRecursion
0 likes · 3 min read
How to Check If a Binary Tree Is Symmetric in O(n) Time