Advntage:
provides CPU scheduling, memory management, file management, and other operating system functions through system calls. The other one is that it is a single large process running entirely in a single address space.
Disadvantage: if anyone service fails it leads to an entire system failure
Answer:
Algorithms is formula for solving a problem. It is helpful because it specifically give instructions detail to computer to what a computer should perform a specific task.
For e.g. calculating report cards.
Answer:
return tmp;
default:
tmp . token_type = ERROR;
return tmp;
1. In the code, input.GetChar() gets the next character from standard input. If GetToken() is called four times, which of the following inputs will return a token whose type is ERROR?
A. ========
A. =<======
B. ===>====
C. =====<==
D. ======<=
Answer:
Make use of hash tables
Explanation:
The appropriate thing to use for this should be a hash table.
A Hash Table can be described as a data structure which stores data in an associative manner. In a hash table, data is stored in an array format, where each data value has its own unique index value. Access of data becomes very fast if we know the index of the desired data. So we can perform Hashing on ISBN Number since its unique and based on the Hash Function w ecan store the Information record.
There is no requirement for printing the file in order - HashTables dont store the data in order of insertions, so no problems with that
It becomes a data structure in which insertion and search operations are very fast irrespective of the size of the data. So Querying books details can be fast and searching will take less time.
It can also be pointed out that it wont be too expensive for Hardware implemtation as HashTables stores data based on Hash Functions and memory consumption is also optimal which reduces memory wastages.
Answer:
Explanation:
The code does not fail on the first step since 1900 divided by 4 is actually 475 and has no remainder, meaning that it should return True. The code won't work because the if statements need to be nested in a different format. The correct algorithm would be the following, which can also be seen in the picture attached below that if we input 1900 it would output is not a leap year as it fails on the division by 400 which gives a remainder of 0.75
input_year = int(input())
if input_year % 4 == 0:
if input_year % 100 == 0:
if input_year % 400 == 0:
print(input_year, "is a leap year")
else:
print(input_year, "- not a leap year")
else:
print(input_year, "is a leap year")
else:
print(input_year, "- not a leap year")