42 data structure day-2

2.1 O  o   omega  theta

1). T1(N)  + T2(N) = max (O (  f( N )),   O(  g( N ) ) ),

T1(N)  *  T2(N)  =O(  f( N )  * g( N )),

2). T(N)  k次多项式    T( N ) theta( N^k ),
 3). log   k   N  =  O(N)
 4). 常数和低阶项可放弃    
 5). (n->8)lim f ( N )/ g( N )   落笔大法则

0   :   o;

!=0:  theta

8  :   g( N) = o( f( N))

摆动: 无关

2.2

实际问题不同与理论模型 空间并非无限  加减乘除并非一个时间但愿

2.3 

T  wrost  

优秀算法与I/O瓶颈

2.4

加减乘除 初始化 自加 判断 各一个时间单位

for循环时间是循环内时间 *  迭代次数  

if  /else取长者

???Fib(N)< (5/3) ^N.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Write a computer program that could be used to track users' activities. Lab Number Computer Station Numbers 1 1-3 2 1-4 3 1-5 4 1-6  You run four computer labs. Each lab contains computer stations that are numbered as the above table.  There are two types of users: student and staff. Each user has a unique ID number. The student ID starts with three characters (for example, SWE or DMT), and is followed by three digits (like, 001). The staff ID only contains digits (for example: 2023007).  Whenever a user logs in, the user’s ID, lab number, the computer station number and login date are transmitted to your system. For example, if user SWE001 logs into station 2 in lab 3 in 01 Dec, 2022, then your system receives (+ SWE001 2 3 1/12/2022) as input data. Similarly, when a user SWE001 logs off in 01 Jan, 2023, then your system receives receives (- SWE001 1/1/ 2023). Please use = for end of input.  When a user logs in or logs off successfully, then display the status of stations in labs. When a user logs off a station successfully, display student id of the user, and the number of days he/she logged into the station.  When a user logs off, we calculate the price for PC use. For student, we charge 0 RMB if the number of days is not greater than 14, and 1 RMB per day for the part over 14 days. For staff, we charge 2 RMB per day if the number of days is not greater than 30, and 4 RMB per day for the part over 30 days.  If a user who is already logged into a computer attempts to log into a second computer, display "invalid login". If a user attempts to log into a computer which is already occupied, display "invalid login". If a user who is not included in the database attempts to log off, display "invalid logoff".
06-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值