Data structures--graphs and sorting exercises and answers

Source: Internet
Author: User
Tags in degrees

2-3

for one with N a graph of the vertices, if the adjacency matrix is represented, the size of the matrix is: (2 points)

    1. N? 1
    2. N
    3. (N? 1)? 2??
    4. N? 2??

Author : DS Course Group

Unit : Zhejiang University

2-4

If a forward graph is represented by an adjacency matrix, the first I the degree to which a node is entered is: (2 points)

    1. Section I number of elements in the row
    2. Section I number of non-0 elements in a row
    3. Section I number of non-0 elements of the column
    4. Section I number of 0 elements in the column

Author : DS Course Group

Unit : Zhejiang University

2-5

which of the following statements about the storage of graphs is correct? (2 points)

    1. Using the neighboring matrix method to store the graph, the number of storage space occupied is only related to the number of nodes in the graph, but not to the number of sides.
    2. Using the neighboring matrix method to store the graph, the number of storage space occupied is only related to the number of edges in the graph, but not to the number of nodes.
    3. Using the Adjacency table method to store the graph, the number of storage space is only related to the number of nodes in the graph, but not to the number of sides.
    4. Using the Adjacency table method to store the graph, the number of storage space is only related to the number of edges in the graph, and it is independent of the number of nodes.

Author : DS Course Group

Unit : Zhejiang University

2-6

on the adjacency matrix of graphs, which of the following conclusions is correct? (2 points)

    1. The adjacency matrix of a forward graph is always asymmetric
    2. The adjacency matrix of a forward graph can be symmetric, or it can be asymmetrical
    3. The adjacency matrix of the non-graph is always asymmetric
    4. The adjacency matrix of a non-graph can be asymmetric, or it can be symmetric

Author : DS Course Group

Unit : Zhejiang University

2-7

Set N a vertex E The graph of the edges is stored with the adjacency table, then the time complexity of each vertex's degree of entry is: (2 points)

    1. O (N)
    2. O (N? 2??)
    3. O (N+E)
    4. O (NxE)

Author : DS Course Group

Unit : Zhejiang University

2-8

In an none graph, the sum of the degrees of all the vertices equals how many times the number of all sides? (2 points)

    1. 1/2
    2. 1
    3. 2
    4. 4

Author : DS Course Group

Unit : Zhejiang University

2-9

in a graph, the sum of the degrees and degrees of all vertices equals the sum of all the edges? (2 points)

    1. 1/2
    2. 1
    3. 2
    4. 4

Author : DS Course Group

Unit : Zhejiang University

2-10

in any given graph, the sum of the degrees of all vertices and the sum of the degrees of all vertices is: (2 points)

    1. Equal
    2. Greater than or equal
    3. Less than or equal
    4. Not sure

Author : DS Course Group

Unit : Zhejiang University

2-11

set the number of vertices of the non-direction graph to N , how many edges does the graph have at most? (2 points)

    1. N? 1
    2. N (N? 1)/2
    3. N (N+ 1)/2
    4. N? 2??

Author : DS Course Group

Unit : Zhejiang University

2-20

The following statements are not correct: (2 points)

    1. The traversal of a graph is accessed only once per vertex from a given source point
    2. There are two basic algorithms of traversal: depth traversal and breadth traversal
    3. The depth traversal of graphs is a recursive process
    4. The depth traversal of a graph does not apply to a graph

Author : DS Course Group

Unit : Zhejiang University

2-21

the depth-first traversal of a graph is similar to a binary tree: (2 points)

    1. First Order traversal
    2. Middle Sequence traversal
    3. Post-post traversal
    4. Hierarchical traversal

Author : DS Course Group

Unit : Zhejiang University

2-22

If you make a depth-first search from any vertex of the non-graph to access all vertices, the graph must be: (2 points)

    1. Connectivity Diagram
    2. Full picture
    3. A diagram with a loop
    4. A tree

Author : DS Course Group

Unit : Zhejiang University

2-23

The breadth-first traversal algorithm from point a in the graph may result in: (2 points)

    1. A, E, D, F, C, b
    2. A, C, F, E, B, D
    3. A, E, B, C, F, D
    4. A, B, E, C, D, F

Author : DS Course Group

Unit : Zhejiang University

2-24

The result of the breadth-first traversal algorithm from the C point in the figure is: (2 points)

    1. C,a,b,e,f,d
    2. C,a,f,d,e,b
    3. C,f,a,d,e,b
    4. C,f,a,b,d,e

Author : DS Course Group

Unit : Zhejiang University

2-18

the adjacency table for a given graph is as follows. Starting from vertex V1 by the breadth-first search method, the resulting vertex sequence is: (2 points)

    1. V1,v2,v3,v4,v5
    2. V1,v2,v3,v5,v4
    3. V1,v3,v2,v4,v5
    4. V1,v4,v3,v5,v2

Author : DS Course Group

Unit : Zhejiang University

2-19

The adjacency matrix of a graph is known as follows, from Vertex V1 start by the breadth-first search method, a vertex sequence that may be obtained is: (2 points)

    1. V1,v2,v3,v5,v4,v6
    2. V1,v2,v4,v5,v6,v3
    3. V1,v3,v5,v2,v4,v6
    4. V1,v3,v5,v6,v4,v2

Author : DS Course Group

Unit : Zhejiang University

2-26

we use a graph to express the airline's route for all flights. Which of the following algorithms is best suited for solving the most economical flight route between two cities? (2 points)

    1. Dijkstra algorithm
    2. Kruskal algorithm
    3. Depth-First Search
    4. Topological sorting algorithm

Author : DS Course Group

Unit : Zhejiang University

2-27

in the data structure What problem does the Dijkstra algorithm use to solve? (2 points)

    1. Critical path
    2. Shortest path
    3. Topological sorting
    4. String match

Author : DS Course Group

Unit : Zhejiang University

2-28

any one of the smallest spanning tree with weighted undirected graphs --(2 points)

    1. is the only
    2. is not unique.
    3. There may not be the only
    4. There may not exist

Author : DS Course Group

Unit : Zhejiang University

2-32

in the Sort method, the method of removing an element from a sorted sequence and sequentially comparing it to an element in the sorted sequence is called: (2 points)

    1. Insert Sort
    2. Select sort
    3. Quick Sort
    4. Merge sort

Author : DS Course Group

Unit : Zhejiang University

2-2

in the graph given below, the degrees and degrees of each vertex are: (2 points)

    1. in degrees : 0, 2, 3, 1, 2; Out of: 3, 2, 1, 1, 1
    2. in degrees : 3, 2, 1, 1, 1; Out of: 0, 2, 3, 1, 2
    3. in degrees : 3, 4, 4, 2, 3; Out of: 3, 4, 4, 2, 3
    4. in degrees : 0, 1, 2, 1, 1; Out of: 3, 2, 1, 1, 1

Author : DS Course Group

Unit : Zhejiang University

2-16

the adjacency table for a given graph is as follows. From the vertex V1 by the depth-first search method, the resulting vertex sequence is: (2 points)

    1. V1,v2,v3,v4,v7,v6,v5
    2. V1,v5,v4,v7,v6,v2,v3
    3. V1,v5,v6,v4,v7,v2,v3
    4. V1,v5,v4,v7,v6,v3,v2

Author : Chen

Unit : Zhejiang University

2-17

the breadth-first traversal of a graph is similar to a binary tree: (2 points)

    1. First Order traversal
    2. Middle Sequence traversal
    3. Post-post traversal
    4. Hierarchical traversal

Author : Chen

Unit : Zhejiang University

2-24

given the adjacency matrix of the permission graph, the total weight of the minimum spanning tree is: (2 points)

    1. 24
    2. 23
    3. 18
    4. 17

Author : Chen

Unit : Zhejiang University

2-12

The following options, not the depth-first search sequence, are: (2 points)

    1. v? 1??, v5??, v4??, v3??, v? 2??
    2. v? 1??, v3??, v2??, v5??, v? 4??
    3. v? 1??, v2??, v5??, v4??, v? 3??
    4. v? 1??, v2??, v3??, v4??, v? 5??

Author : DS Course Group

Unit : Zhejiang University

2-25

using Dijkstra ( Dijkstra) algorithm to find the shortest path from vertex 1 to other vertices, in order to get the shortest path of the target vertex is: (2 points)

    1. 5, 2, 3, 4, 6
    2. 5, 2, 3, 6, 4
    3. 5, 2, 4, 3, 6
    4. 5, 2, 6, 3, 4

Author : DS Course Group

Unit : Zhejiang University

0-s

The adjacency matrix for a given graph is as follows:

The degrees and degrees of the vertex 2 (numbering starting from 0) are: (2 points)

    1. 3, 1
    2. 1, 3
    3. 0, 2
    4. 2, 0

Author : Chen

Unit : Zhejiang University

2-13

if the depth-first search sequence of a graph is {V1, V4, V0, V3, V2}, which of the following graphs cannot be aligned to the sequence? (2 points)

Author : Chen

Unit : Zhejiang University

2-14

if the depth-first search sequence of a graph is {V2, V0, V4, V3, V1}, which of the following graphs cannot be aligned to the sequence? (2 points)

Author : Chen

Unit : Zhejiang University

2-30

in the following internal sorting algorithms, the average time complexity for sorting is O (nlog? 2?? N) is the algorithm (). (2 points)

    1. Direct Select sort
    2. Quick Sort
    3. Direct Insert Sort
    4. Bubble sort

Author : Shang

Unit : City College of Zhejiang University

2-31

as far as average performance is concerned, the best way to do this is to sort by (). (2 points)

    1. Hill
    2. Bubble
    3. Fast
    4. Exchange

Author : Shang

Unit : City College of Zhejiang University

2-29

(Neuds) The record with the highest key value from the sequence to be sorted is placed in an ordered sequence called (). (2 points)

    1. Hill sort
    2. Direct Select sort
    3. Bubble sort
    4. Quick Sort

Title Answer result Score
2-3d Answer right 2
2-4c Answer right 2
2-5A Answer right 2
2-6b Answer right 2
2-7c Answer right 2
2-8c Answer right 2
2-9c Answer right 2
2-10A Answer right 2
2-11B Answer right 2
2-20d Answer right 2
2-21a Answer right 2
2-22A Answer right 2
2-23d Answer right 2
2-24c Answer right 2
2-18c Answer right 2
2-19a Answer right 2
2-26a Answer right 2
2-27b Answer right 2
2-28c Answer right 2
2-32A Answer right 2
2-2A Answer right 2
2-16d Answer right 2
2-17d Answer right 2
2-24b Answer right 2
2-12d Answer right 2
2-25b Answer right 2
2-1c Answer right 2
2-13c Answer right 2
2-14d Answer right 2
2-30b Answer right 2
2-31c Answer right 2
2-29b Answer right 2

Data structures--graphs and sorting exercises and answers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.