# Sample output for CS3114 Project 1 (DNA sequence memory manager) # Lines prefixed in this description by "#" probably would not be # printed by your program, they are just my explanation. # Commands are echo'ed as received, prefixed here by "> ". Empty lines # are skipped. # This output file assumes that the program was invoked with a memory # pool size of 100 and a record array of 10. > print # There is nothing in the pool a this point, so the record array is # clear and the memory pool consists of a single free block of 100 # spaces. Record array: 0: NULL 1: NULL 2: NULL 3: NULL 4: NULL 5: NULL 6: NULL 7: NULL 8: NULL 9: NULL # In the freeblock list, I will put * by the block that is "current" # in the circular first fit process Freeblock list: *0:100 > insert 3 AAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTT # Should echo the command in the output, but nothing else needs to be # printed. Since this string is 40 characters long, it needs 10 bytes # in the memory pool, preceded by 2 bytes for the length indicator, # for a total allocation fo 12 bytes. You probably should output something # like this: Successfully inserted message of 12 bytes (40 characters) starting at position 0. > print 3 # We have what we just inserted. The record array will store a handle, # and it will store the logical length of the message (since the memory # manager can't know anything execpt the message length, which is going # to be a multiple of four characters whether that is right or not). # Note that the record array cannot know anything about the contents # of the handle, so it is unable to print out the information. The # memory manager class should supply a method for printing or # otherwise generating this information (the start position and # length). And the message itself should be retrieved and printed. 3: 0:12, 40: AAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTT > print # Now we have one record in the memory pool, leaving one free block. Record array: 0: NULL 1: NULL 2: NULL 3: 0:12, 40: AAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTT 4: NULL 5: NULL 6: NULL 7: NULL 8: NULL 9: NULL Freeblock list: *12:88 > print 0 # There is nothing at record array position 0. 0: NULL > insert 0 AAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTT Successfully inserted message of 12 bytes (40 characters) starting at position 12. > print Record array: 0: 12:12, 40 AAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTT 1: NULL 2: NULL 3: 0:12, 40 AAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTT 4: NULL 5: NULL 6: NULL 7: NULL 8: NULL 9: NULL Freeblock list: *24:76 > insert 2 AAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTTAAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTT Successfully inserted message of 22 bytes (80 characters) starting at position 24. > insert 0 AAAA Deleted old message of 12 bytes (40 characters) from memory pool position 12. Successfully inserted message of 3 bytes (4 characters) starting at position 46. > print Record array: 0: 46:3, 4 AAAA 1: NULL 2: 24:22, 80 AAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTTAAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTT 3: 0:12, 40 AAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTT 4: NULL 5: NULL 6: NULL 7: NULL 8: NULL 9: NULL Freeblock list: 12:12, *49:51 > remove 0 Deleted message of 3 bytes (4 characters) from memory pool position 46. > print # Note that we merged blocks here. Record array: 0: NULL 1: NULL 2: 24:22, 80 AAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTTAAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTT 3: 0:12, 40 AAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTT 4: NULL 5: NULL 6: NULL 7: NULL 8: NULL 9: NULL Freeblock list: 12:12, *46:54 > insert 20 ATTT # This is illegal Unable to insert using record array position 20. > insert 1 AAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTTGGGGTTTTAAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTTGGGGTTTTAAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTTGGGGTTTTAAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTTGGGGTTTTAAAATTTTCCCCGGGGAAAACCCCGGGGTTTTAAAATTTTGGGGT # Note that this string has 237 characters. This requires 60 bytes # (the last byte having only one character) plus 2 bytes for the # length, for a total message size of 62. We cannot store that because # there is no free block of size 62 (even if the total amount of free # space in the pool adds up to more than 62). Unable to insert a message of 62 bytes (237 characters).