在本文中,我们将详细介绍为庆祝OpenWrt20周年,官方计划推出OpenWrtOne路由器的各个方面,并为您提供关于openwrt官方支持路由器的相关解答,同时,我们也将为您带来关于Algorith
在本文中,我们将详细介绍为庆祝 OpenWrt 20 周年,官方计划推出 OpenWrt One 路由器的各个方面,并为您提供关于openwrt官方支持路由器的相关解答,同时,我们也将为您带来关于Algorithm One Day One -- 判断链表是否有环 (上)、Algorithm One Day One -- 判断链表是否有环 (下)、Algorithm One Day One -- 约瑟夫环(丢手绢问题)、Algorithm One Day One--求输入的数组其子数组的最大值的有用知识。
本文目录一览:- 为庆祝 OpenWrt 20 周年,官方计划推出 OpenWrt One 路由器(openwrt官方支持路由器)
- Algorithm One Day One -- 判断链表是否有环 (上)
- Algorithm One Day One -- 判断链表是否有环 (下)
- Algorithm One Day One -- 约瑟夫环(丢手绢问题)
- Algorithm One Day One--求输入的数组其子数组的最大值
为庆祝 OpenWrt 20 周年,官方计划推出 OpenWrt One 路由器(openwrt官方支持路由器)

根据 OpenWrt 开发者邮件列表的消息,项目贡献者 John Crispin 写道:“OpenWrt 项目即将诞生 20 周年!让我们通过推出首个完全由上游支持的硬件设计来庆祝这一周年纪念日。”
这款路由器将被命名为 "OpenWrt One/AP-24.XY",硬件规格暂定如下:
-
SoC:联发科 MT7981B
-
Wi-Fi:联发科 MT7976C(2x2 2.4 GHz + 3x3/2x2 + 零等待 DFS 5Ghz)
-
内存:1 GiB DDR4
-
闪存: 128 MB SPI NAND+ 4 MB SPI NOR
-
以太网:2.5 GbE + 1 GbE
-
USB(主机): USB 2.0-A
-
USB(设备、主机): Holtek HT42B534-2 UART 至 USB-C
-
存储:M.2 2042(PCIe Gen 2 x1)NVMe SSD
-
按钮:2 个(复位 + 用户)
-
机械开关:1 个,用于启动选择(恢复、常规)
-
LED 指示灯:2 个(PWM 驱动),2 个 ETH 指示灯(GPIO 驱动)
-
外部安全硬件: EM Microelectronic EM6324(GPIO 驱动)
-
RTC:NXP PCF8563TS(I2C),带备用电池座(CR1220)
-
电源: USB-C 的 USB-PD-12V (通过 RT5040 模块可选 802.3at /afPoE)。
-
扩展:mikroBUS
-
认证: 符合 FCC / EC / RoHS 标准
-
外壳: PCB 尺寸与 BPi-R4 兼容,外壳采用可再生材料
-
主 SOC 的 JTAG:10 针 1.27 mm 间距(ARM JTAG / SWD)
-
天线连接器: 3x MMCX
-
原理图:将公开(许可证待定)
-
符合 GPL 规范: 3b.
-
价格目标:力争低于 100 美元
John Crispin 表示,早在 2017 年和 2018 年的 OpenWrt 峰会上,他们就首次提到要推出 OpenWrt 路由器。从 2023 年 12 月开始,他们在修复 Banana Pi 设备遇到的 bug 时就清楚地意识到,该设备已经非常接近他们想要在 17/18 年实现的目标。
Banana PI 在社区中越来越受欢迎。它们使用自编译的可信固件 - A (TF-A) 和上游 U-Boot 启动,并且某些主板已经得到上游 Linux 内核的完全支持。唯一的非开源组件是在独立内核上运行的 2.5 GbE PHY 和 Wi-Fi 固件 blob,这些内核独立于运行 Linux 的主 SoC 以及在启动早期执行的 DRAM 校准例程。
OpenWrt 项目是一个针对嵌入式设备的 Linux 操作系统。OpenWrt 不是一个单一且不可更改的固件,而是提供了具有软件包管理功能的完全可写的文件系统。这使您可以从供应商提供的应用范围和配置中解脱出来,并且让您通过使用适配任何应用的软件包来定制设备。对于开发人员来说,OpenWrt 是一个无需围绕它构建完整固件就能开发应用程序的框架;对于普通用户来说,这意味着拥有了完全定制的能力,能以意想不到的方式使用该设备。
Algorithm One Day One -- 判断链表是否有环 (上)
Is a loop ? Question descrip as follows :
Assume that wehave a head pointer to a link-list. Also assumethat we know the list is single-linked. Can you come up an algorithm to checkwhether this link list includes a loop by using O(n) time and O(1) space wheren is the length of the list? Furthermore, can you do so with O(n) time and onlyone register?
/********************************************************************
created:2015年1月22日 00:54:56
author: Jackery
purpose: Is there a loop ?
*********************************************************************/
#include"stdafx.h"
#include<iostream>
using namespace std;
typedef struct node
{
int data;
struct node *next;
}Node,*pNode;
Node *Create(int *numNode)
{
//创建一个链表
Node *head,*tail,*cnew;
head=NULL;
int num;
cout <<"输入数据(以#键结束):" << endl;
while(1 )
{
cin >>num ;
if(''#''==getchar())
//以#键表示输入结束
break;
cnew=new Node;;
cnew->data=num;
cnew->next=NULL;
if(head==NULL)
//若为空则将头节点指向新节点
head=cnew;
else
tail->next=cnew;
//将当前节点的next指向新的节点
tail=cnew;
(*numNode)++;
}
return head;}
/*判断是否有环思路概述:分别定义步长为1和2的指针fast and slow
指向头结点,if无环,则fast先走到终点;如果链表长度为奇数时,
fast->Next为空;当链表长度为偶数时,fast为空*/
bool isLoop(pNode pHead)
{
pNode fast = pHead;
pNode slow = pHead;
while( fast != NULL && fast->next != NULL)
{
fast = fast->next->next;
slow = slow->next;
//如果有环,则fast会超过slow一圈
if(fast == slow)
{
break;
}
}
if(fast == NULL || fast->next == NULL )
{
cout <<"Wow,there is not loop in the list "<< endl;
return false;
}
else
{
cout <<"Yeah,there is loop in the list " << endl;
return true;
}
}
int main(int argc ,char * argv[])
{
int numnode=0;
//初始化将节点个数初始化为零
pNode head=NULL ;
cout <<"链表head的节点个数为: " <<endl;
cin >>numnode;
head=Create(&numnode);
isLoop(head);
return 0;
}
Algorithm One Day One -- 判断链表是否有环 (下)
在 Is there a loop (上) 中,我们判断了一个单向链表有没有环,接下来我们继续探索 if 有环,环的长度以及环的入口点。限于篇幅,再次不贴完整代码!
/********************************************************************
created:2015年1月23日 00:34:45
author: Jackery
purpose: Is there a loop ? 《Continue》
*********************************************************************/
//计算环的长度
/*对于其中的stepfast与stepslow能与能相遇这个问题,不太好理解,涉及到
类似欧拉回路的问题,胡运权的运筹学上面有相关类似讲解,不过
你完全可以写个小demo去验证,对于这个换是奇数、偶数我都验证了
,都是可行的*/
int LoopLength(pNode pHead)
{
if(isLoop(pHead) == false)
return 0;
pNode stepfast = pHead;
pNode stepslow = pHead;
int length = 0;
bool begin = false;
bool agian = false;
while( stepfast != NULL && stepfast->next != NULL)
{
stepfast = stepfast->next->next;
stepslow = stepslow->next;
//超两圈后停止计数,跳出循环
if(stepfast == stepslow && agian == true)
break;
//超一圈后开始计数
if(stepfast == stepslow && agian == false)
{
begin = true;
agian = true;
}
//计数
if(begin == true)
++length;
}
return length;
}
//求出环的入口点
Node* FindLoopEntrance(pNode pHead)
{
pNode stepfast = pHead;
pNode stepslow = pHead;
while( stepfast != NULL && stepfast->next != NULL)
{
stepfast = stepfast->next->next;
stepslow = stepslow->next;
//如果有环,则stepfast会超过stepslow一圈
if(stepfast == stepslow)
{
break;
}
}
if(stepfast == NULL || stepfast->next == NULL)
return NULL;
stepslow = pHead;
while(stepslow != stepfast)
{
stepslow = stepslow->next;
stepfast = stepfast->next;
}
return stepslow;
}
Algorithm One Day One -- 约瑟夫环(丢手绢问题)
算法是编程的灵魂,是编程思想的精髓————Algorithm One Day One
/********************************************************************
created:2015年1月20日 23:06:46
author: Jackery
purpose: Joseph problem
*********************************************************************/
#include"stdafx.h"
#include<iostream>
using namespace std;
typedef struct _Node
{
int data;
struct _Node*next;
} node_t;
typedef struct _Linklist
{
node_t*phead;
node_t*ptail;
int len;
}Linklist;
static node_t*GetNode(int i )//新建并初始化节点
{
node_t*pNode;
pNode=new node_t;
if(!pNode)
{
cout <<"内存分配失败" <<endl;
exit(-1);
}
pNode->data=i;
pNode->next=NULL;
return pNode;
delete pNode;
}
void init_list(Linklist*plist)//用第一个节点初始化循环单链表
{
node_t*p;
p=GetNode(1);
//printf("TheNewNodeis:%d\n",p->data);//****TEST****
plist->phead=p;
plist->ptail=p;
p->next=plist->phead;
plist->len=1;
}
//把其余数据添加到循环单链表中
static void Create_List(Linklist*plist,int n)
{
int i=0;
node_t*pNew;
for(i=2;i<=n;i++)
{
pNew=GetNode(i);
/********TEST********
cout <<"The New Node is:" <<pNew->data << endl;
********TEST********/
plist->ptail->next=pNew;
plist->ptail=pNew;
pNew->next=plist->phead;
plist->len++;
}
}
//输出链表内容
// void Print_List(Linklist*plist)
// {
// node_t*pCur=plist->phead;
// do
// {
// cout << "The "<< pCur->data <<"person." <<endl;
// pCur=pCur->next;
// }while(pCur!=plist->phead);
// cout << "The length of the List "<< plist->len<< endl;;
// }
//Joseph function implement
void joseph(Linklist* plist,int m,int k)
{
node_t *pPre=plist->ptail;
node_t *pCur=plist->phead;
int i,j;
cout << "出队列的顺序依次为: "<< endl;
while(plist->len != 1)
{
i=0;
j=0;
while(j<k-1)
{
pPre=pPre->next;
j++;
}
while(i< m -1)
{
pPre=pPre->next;
i++;
}
pCur=pPre->next;
int temp=pCur->data;
cout <<"第 " << temp << " 个人 "<< endl ;
pPre->next=pCur->next;
free(pCur);
plist->len--;
}
cout <<"第 " << pPre->data << " 个人" << endl; ;
cout << "The last one is:" << pPre->data<< endl;
}
int main(int argc, char * argv[])
{
int n=0;
cout <<"约瑟夫环长度为 : "<<endl;;
cin >> n;
int m=0;
cout << "每此数到m个时,此人出列"<<endl;
int k;
cin >> k;
cout << "从第k 个开始数" << endl;
cin >>m;
Linklist pList;
init_list(&pList);
Create_List(&pList,n);
// Print_List(&pList);
joseph(&pList,m,k);
return 0;
}
Algorithm One Day One--求输入的数组其子数组的最大值
算法是编程的灵魂,是编程思想的精髓————Algorithm One Day One/********************************************************************
created:2015年1月19日 00:20:59
author: Jackery T(n)=Ο(n)
purpose: 本程序是求输入的一个数组,求其子数组的最大值;
*********************************************************************/
#include"stdafx.h"
#include<iostream>
typedef int DataType;
DataType Arrlen(DataType array[]);
void SubAarr_MaxSum(DataType array[], DataType len);
using namespace std;
void main()
{
DataType array[]={0,12,-11,5};
DataType length=sizeof(array)/sizeof(DataType);
SubAarr_MaxSum(array,length);
}
void SubAarr_MaxSum(DataType array[], DataType len)
{
if(NULL == array || len <=0){
return;
}
int curSum = 0, SubAarr_MaxSum = 0;
//首先考虑数组有正、有负或者有零的情况
for(int i=0; i<len; i++){
curSum += array[i]; // 累加
if(curSum < 0){ // 当前和小于0,重置为0
curSum = 0;
}
// 当前和大于最大和,则重置最大和
if(curSum > SubAarr_MaxSum){
SubAarr_MaxSum = curSum;
}
}
//接下来考虑数组中元素均为零的情况
if(SubAarr_MaxSum == 0){
SubAarr_MaxSum = array[0];
for(int i=1; i<len; i++){
if(array[i] > SubAarr_MaxSum){
SubAarr_MaxSum = array[i];
}
}
}
cout << "最大子数组的和为:" << endl;
cout << "SubAarr_MaxSum= " << SubAarr_MaxSum<< endl;
}
To be improved :
1.实现动态输入数组;
2.如何找出其子数组中最大数组所在数组的元素并输出;
我们今天的关于为庆祝 OpenWrt 20 周年,官方计划推出 OpenWrt One 路由器和openwrt官方支持路由器的分享就到这里,谢谢您的阅读,如果想了解更多关于Algorithm One Day One -- 判断链表是否有环 (上)、Algorithm One Day One -- 判断链表是否有环 (下)、Algorithm One Day One -- 约瑟夫环(丢手绢问题)、Algorithm One Day One--求输入的数组其子数组的最大值的相关信息,可以在本站进行搜索。
本文标签: