Lecture 15_Algorithm_Graph_Review.pptx

10 6 0
Lecture 15_Algorithm_Graph_Review.pptx

Đang tải... (xem toàn văn)

Thông tin tài liệu

Algorithm and Graph Review Sort Given a list A of n numbers Your task is to write the function MergeSort(A, n) to sort the numbers increasingly 2 Recursive function Your task is to write a function to[.]

Algorithm and Graph Review Sort Given a list A of n numbers Your task is to write the function MergeSort(A, n) to sort the numbers increasingly Recursive function Your task is to write a function to output all permutations of n elements Example: All permutations of n = 123, 132, 213, 231, 312, 321 Recursive function Your task is to write a function to output all binary numbers of length n and the number of ‘1’ digits is smaller or equal to the number of ‘0’ digits Example: The output of n = 000,001,010,100 Dynamic programming Given a sequence of n integer numbers A(1) A(n), your task is to write a function to find the longest subsequence (not necessarily contiguous) in which the values in the subsequence form a strictly increasing sequence Example: 10 15 12 11 17 13 16 Output: 11 13 16 Graph Given an undirected computer network with n nodes (numbered from to n) and m edges, your task is to write a program to calculate the number of connected components that each contains at least three nodes Topological sorting Given n jobs (numbered from to n) and m order requirements Each order requirement is a pair of two jobs u and v indicating that job u must be done before job v Your task is to write a program to order these jobs to fulfill the order requirements Shortest Path Given n cities (numbered from to n) and m roads connecting cities The traffic level between two cities u, v is D[u,v] You have two tasks: ❖ Write a program to find a path from a starting point s to the end point e such that the total traffic level on the path is the smallest ❖ Write a program to find the smallest traffic Regular Expression Write a regular expression that matches these numbers: ❖ (123) 456 7899 ❖ (123).456.7899 ❖ (123)-456-7899 ❖ 123-456-7899 ❖ 123 456 7899 ❖ 1234567899 Regular Expression Your task is to write a regular expression for an email 10

Ngày đăng: 27/10/2023, 11:01

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan