当前位置:网站首页>4.21总结
4.21总结
2022-04-22 15:52:00 【ls真的不会啊】
完成了项目的建表,服务器的搭建
建表:
- 用户表(user_data)
id:用户的账号
name:用户的昵称
password:用户的密码
sex:性别
age:年龄
photo:头像(这个不确定用哪种类型,varchar、blob或者是其他的,先暂时用varchar)
state:用户的状态(0表示离线,1表示在线)
introduction:简介
nationality:国籍
province:省份
city:城市
- 好友表(friend_id)
user_id:用户的账号
friend_id:好友的账号
state:?关系状态,正常:1,拉黑:0
?在线状态,在线:1,离线:0
link:是否是好友,是:1,不是:0
- 我的群聊(my_group)
group_id:群聊的账号
group_name:群聊的名称
group_member_num:群聊的人数
- 群成员(group_member)
group_id:群聊的账号
group_name:群聊的名称
member_id:群成员的账号
member_name:群成员的昵称
member_state:群成员的身份,群主:2,管理员:1,普通成员:0
link:是否是群成员
- 私聊消息记录(individual_chatmsg)
send_id:发送者的id
receieve_id:接收者的id
message:消息的具体内容
state:发送状态,成功:1,失败:0
link:接收状态,当对方离线时,发送过来的消息不能及时被对方接收。已接受:1,未接收:0(未接收的消息可能需要存放到另外一张表)
- 群聊消息记录(group_chatmsg)
group_id:群聊的账号
group_name:群聊的名称
send_id:发送者的id
receieve_id:接收者的id
message:消息的具体内容
state:发送状态,成功:1,失败:0
- 好友申请(friend_request)
send_id:发送者的id
send_name:发送者的昵称
receieve_id:接收者的id
receieve_name:接收者的昵称
state:发送状态
- 加入群聊申请(group_request)
send_id:发送者的id
receieve_id:接收者的id
group_id:申请加入的群聊的账号
group_name:申请加入的群聊的名称
state:发送状态
link:处理状态,已处理:1,未处理:0
- 文件传输(file_delievery)
send_id:发送者的id
receieve_id:接收者的id
file_name:文件名称
state:发送状态
每日一题
83. 删除排序链表中的重复元素 - 力扣(LeetCode) (leetcode-cn.com)
给定一个已排序的链表的头 head , 删除所有重复的元素,使每个元素只出现一次 。返回 已排序的链表 。
示例 1:
输入:head = [1,1,2]
输出:[1,2]
示例 2:
输入:head = [1,1,2,3,3]
输出:[1,2,3]
提示:
链表中节点数目在范围 [0, 300] 内
-100 <= Node.val <= 100
题目数据保证链表已经按升序 排列
思路
首先,链表已经按升序排列,所以每次遍历完一个结点并且移动到下一个结点的时候,只需要遍历移动到的那个结点后面的元素。
然后,当链表为空或者只有一个结点的特殊情况时,直接返回头结点就可以了。
再就是,排除上面的特殊情况,从头结点开始遍历,将头结点后面的结点与头结点进行比较,有相同的值的结点就删除(改变指针的指向),第一次遍历完成后,将指针移动到头结点后面一个结点,将该结点与它后面的结点进行比较,有相同的值的结点就删除(改变指针的指向),第二次遍历完成,后面依次进行。
最后,返回头结点。
代码实现
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* deleteDuplicates(ListNode* head) {
if(head==NULL||head->next==NULL)
{
return head;
}
ListNode* p;
ListNode* q;
p=head;
while(p!=NULL)
{
q=p;
while(q->next!=NULL)
{
if(p->val==q->next->val)
{
q->next=q->next->next;
}
else
{
q=q->next;
}
}
p=p->next;
}
return head;
}
};
版权声明
本文为[ls真的不会啊]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_63514555/article/details/124331379
边栏推荐
- [in depth understanding of tcallusdb technology] sample code for reading the data of the specified location in the list - [list table]
- Go 语言二维或多维数组 / 切片定义上的小坑
- [in depth understanding of tcallusdb technology] sample code for reading data according to some key field values - [generic table]
- 社区运营书籍推荐
- Dongfeng Nissan recalls some Xiaoke with potential safety hazards
- [in-depth understanding of tcallusdb technology] sample code for reading all data in the list - [list table]
- OopMap理论篇
- [in depth understanding of tcallusdb technology] example code for deleting data - [generic table]
- Redis optimization series (I) building redis master-slave based on docker
- ‘telnet‘ 不是内部或外部命令也不是可运行的程序或批处理文件
猜你喜欢

For the professional development of teacher Guo, write down your experience

Future development direction of construction industry: digital chemical plant management system
![[yolact dataset production - detailed explanation of labelme use and conversion to coco]](/img/cb/dca65315c985cf62f47e3cc333400c.png)
[yolact dataset production - detailed explanation of labelme use and conversion to coco]
![[二叉数]相同的树](/img/5d/48bf7a987eeb45d0a1cbf836e3b1e7.png)
[二叉数]相同的树
![[in depth understanding of tcallusdb technology] sample code of batch reading data - [generic table]](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[in depth understanding of tcallusdb technology] sample code of batch reading data - [generic table]

Build your own web site (8)

制作的自媒体短视频很模糊?教你3个方法,让视频变清晰

【基于合泰HT32F52352+oled温湿度显示】

阿里云国际版设置电子邮件托管教程详解

Construction method and process of enterprise level knowledge management (km)
随机推荐
Yunna | the latest measures for the management of fixed assets in the hotel industry, hotel physical asset management system
Construction method and process of enterprise level knowledge management (km)
图形学101 矩阵变换(2~4节)
Redis optimization series (I) building redis master-slave based on docker
Reverse linked list (and) the intermediate node of the linked list
LeetCode每日一题——824. 山羊拉丁文
Future development direction of construction industry: digital chemical plant management system
How redis solves the performance bottleneck caused by frequent command round trips!
How can AI intelligent video technology be applied to the scene of daily maintenance and supervision of cultural relics and historic buildings?
报名开启|QKE 容器引擎托管版暨容器生态发布会!
Radio button selected
[in depth understanding of tcallusdb technology] sample code of scanning data - [generic table]
Ansible 实用技巧 - 批量巡检站点 URL 状态
Is the account of digging money safe? How to handle it?
Clothing private domain + supply chain management
阿里云国际版设置电子邮件托管教程详解
Talk about data subcontracting and related tips
Computer taskbar stuck
NFT是否会冲击互联网原生文化?
SAP UI5 应用开发教程之七十一 - SAP UI5 页面的嵌套路由

