| |

VerySource

 Forgot password?
 Register
Search
View: 770|Reply: 2

Please master help! !! !! Fragment size

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-3 23:10:01
| Show all posts |Read mode
typedef struct
{
unsigned short offSet; // Start offset of idle fragments in Frame
unsigned short size; // free fragment size
} Frag;
    

vector <Frag> myTbl;
How do I find the maximum value of the fragment in myTbl (fragment table)? In this way, the record I want to write can be compared with the maximum value in the fragment. If it is smaller than the maximum value, it can be put in, otherwise, a new space needs to be opened for storage.
  Thank you! :)
Reply

Use magic Report

0

Threads

57

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-1-4 00:27:01
| Show all posts
Sort it first, then take a maximum endpoint, but sorting recommends that the container use list
Reply

Use magic Report

0

Threads

22

Posts

18.00

Credits

Newbie

Rank: 1

Credits
18.00

 China

Post time: 2020-1-4 10:15:01
| Show all posts
Linked list
Similar to this content, you can refer to
http://community.csdn.net/Expert/topic/5269/5269166.xml?temp=.3451959
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list