-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMiniTwitter.java
More file actions
54 lines (49 loc) · 1.44 KB
/
Copy pathMiniTwitter.java
File metadata and controls
54 lines (49 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package leetcode;
import java.util.*;
public class MiniTwitter {
class Tweet {
public static int id;
public int user_id;
public String text;
public Tweet create(int user_id, String tweet_text) {
return new Tweet(user_id,tweet_text);
}
public Tweet(int user_id, String tweet_text){
this.user_id = user_id;
this.text = tweet_text;
}
}
public MiniTwitter() {
// initialize your data structure here.
}
// @param user_id an integer
// @param tweet a string
// return a tweet
public Tweet postTweet(int user_id, String tweet_text) {
// Write your code here
}
// @param user_id an integer
// return a list of 10 new feeds recently
// and sort by timeline
public List<Tweet> getNewsFeed(int user_id) {
// Write your code here
}
// @param user_id an integer
// return a list of 10 new posts recently
// and sort by timeline
public List<Tweet> getTimeline(int user_id) {
// Write your code here
}
// @param from_user_id an integer
// @param to_user_id an integer
// from user_id follows to_user_id
public void follow(int from_user_id, int to_user_id) {
// Write your code here
}
// @param from_user_id an integer
// @param to_user_id an integer
// from user_id unfollows to_user_id
public void unfollow(int from_user_id, int to_user_id) {
// Write your code here
}
}