Câu hỏi phỏng vấn Data Structures
Câu hỏi

What is a Graph?

Câu trả lời

What is a Graph?

A graph is a data structure that consists of a set of nodes (also called vertices) and a set of edges that connect these nodes. Graphs are used to represent relationships or connections between different entities.

Here are the key characteristics of a graph:

Nodes (Vertices)

The nodes or vertices represent the individual elements or objects in the graph. These can be anything from people, places, things, or abstract concepts.

Edges

The edges represent the connections or relationships between the nodes. Edges can be either directed (one-way) or undirected (two-way).

Adjacency

Two nodes are considered adjacent if they are connected by an edge. The set of nodes that are adjacent to a given node are called its neighbors.

Weighted vs Unweighted

Graphs can be either weighted, where each edge has an associated numerical value or weight, or unweighted, where all edges have the same weight (usually 1).

Directed vs...

entry

entry

Gợi ý câu hỏi phỏng vấn

junior

Why and when should I use Stack or Queue data structures instead of Arrays/Lists?

middle

What does Sparse Array mean?

entry

Define Binary Tre

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào