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

What are some types of Queue?

entry

What is Priority Queue?

entry

Name some characteristics of Array Data Structure

Bình luận

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

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