# 算法基础作业代写｜COMP10002 Foundations of Algorithms Semester 2, 2023 Assignment 2

## 这是一篇来自澳洲的关于演示对结构、链接数据结构和算法时间复杂度分析的理解和进一步扩展在项目设计和实施方面技能的算法基础作业代写

1 Learning Outcomes

In this assignment you will demonstrate your understanding of structures, linked data structures, and algorithm time complexity analysis. You will further extend your skills in program design and implementation.

2 The Story…

In Assignment 1, we have tasted supervised learning, which is a major subcategory of machine learning that uses training datasets to derive parameters for mathematical models. In this assignment, we will try out another major subcategory of machine learning, unsupervised learning, in particular, clustering, which discovers data patterns by grouping a set of objects such that objects in the same group are more similar to each other than to those in other groups. Like before, you don’t need to be an expert in machine learning for the assignment. We will guide you through the process step by step.

Social network apps, such as Facebook, Twitter, and WeChat, have become prevalent and are now part of our daily lives. A lot of opportunities and challenges arise from such apps. A challenge to look at in this assignment is called community detection, which aims to fifind groups of social network app users that are densely connected, that is, “following” each other (or, in a “friendship”). Figure 1 illustrates two communities (each enclosed by a red dashed curve) detected from a social network of 12 users u0, u1, . . .,u11, where two users connected by a line is considered to be in a friendship.

The given input to the program has three sections (a sample input is shown below):

1. At least two and up to 50 lines of user profifiles. Each line represents a user, which starts with ‘u[i]’ where 0 <= i < 50 represents the user number. For simplicity, each user number is the same as the line number, that is, user number i will appear at line i. Each user profifile line then contains a four-digit positive integer representing the year when the user joined the social network. After that,each line contains at least one and up to 10 hashtags separated by single whitespace characters. Each hashtag starts with a ‘#’ symbol, followed by at least one and up to 20 lower-case English letters.

In the sample input below, user u0 is at line 0, who joined the social network in the year 2018, with hashtags #foodiesofinstagram, #foodies, and #fresh.

1. An n × n friendship matrix, where n represents the number of users (in the sample input, there are 12 user profifile lines, and so n = 12). The element at row i, column j of the matrix represents whether users ui and uj are in a friendship. If so, the element has a value of 1, and 0 otherwise.

The friendship matrix in the sample input below corresponds to the social network in Figure 1, where user u0 is in a friendship with users u1, u2, and u3. Thus, in the friendship matrix, columns 1, 2, and 3 of row 0 are all 1’s, while the rest of row 0 are all 0’s.

To simplify the discussion, this assignment assumes two-way friendships, that is, two users must follow each other at the same time (in a friendship), or they do not follow each other at all (not in a friendship). This means that the friendship matrix is symmetric.

1. Two threshold values ths (a positive real number) and thc (a positive integer) separated by a whites-pace character, which will be described and used in Stage 4.

u0 2018 #foodiesofinstagram #foodies #fresh

u1 2011 #local #togo #yummy #keyfooddeli #supportsmallbusiness #foodlover

u2 2013 #foodlover #yummy #dinner #foodies #togo

u3 2014 #foodies

u5 2022 #melbournedemons #richmondtigers #sydneyswans

u6 2021 #mcg #richmondfc #footy

u7 2014 #aussierulesfootball #melbournefc #aflfinals

u8 2019 #afl #footy #football #aussierules #aflw #sport #aussie #melb #syd #tas

u9 2017 #sydneyswans #nfl #aussie #melbournedemons #footy

u10 2018 #startreck

u11 2015 #starwars

0 1 1 1 0 0 0 0 0 0 0 0

1 0 1 1 0 0 0 0 0 0 0 0

1 1 0 1 1 0 0 0 0 0 0 0

1 1 1 0 0 0 0 0 0 0 0 0

0 0 1 0 0 1 0 0 0 0 0 0

0 0 0 0 1 0 1 1 1 0 0 0

0 0 0 0 0 1 0 1 0 1 0 0

0 0 0 0 0 1 1 0 1 1 0 0

0 0 0 0 0 1 0 1 0 1 0 1

0 0 0 0 0 0 1 1 1 0 1 0

0 0 0 0 0 0 0 0 0 1 0 0

0 0 0 0 0 0 0 0 1 0 0 0

0.3 2

You may assume that the test data always follows the format above. No input validity checking is needed.

You will be given a skeleton code fifile named program.c for this assignment on Canvas. The skeleton code fifile contains a main function that has been partially completed. There are a few other functions which are incomplete. You need to add code to all the functions including the main function for the following tasks.

…….

E-mail: vipdue@outlook.com  微信号:vipnxx