![lizzie3545](/avatars/21023.jpg)
lizzie3545
20.12.2019 •
Computers and Technology
Assume the configuration: a b c where a-b has an mtu of 2100 bytes and b-c has an mtu of 700 bytes. assume that link layer frames require 30 bytes of overhead, an ip header is 20 bytes, there is no loss in the network, and a always tries to send full frames to c. for every packet that a sends, how many ip packets will cross the link from b to c? a. 6 packetsb. 5 packetsc. 3 packetsd. 4 packets
Solved
Show answers
More tips
- G Goods and services How to Choose a Coffee Maker? The Ultimate Guide for Coffee Lovers...
- O Other How to Accidentally Get a Rare Coin with Your Change and How to Know Its Value?...
- S Society and Politics How Could Nobody Know About the Dead Mountaineers?...
- D Dating, Love, Relationships Why do we feel shame?...
- F Family and Home Why Does God Punish Us Constantly and How Can We Fix It?...
- F Family and Home Do Lullabies Help Babies Sleep or Is it Just a Myth?...
- B Business and Finance How to Get Your Money Back When Lending? Top 7 Ways...
- S Society and Politics Выборы: Смысл, Значение и Отражение...
- D Dating, Love, Relationships Why Should the Man be Active and the Woman Passive during Foreplay?...
- P Philosophy How did the concept of module arise in computer science?...
Answers on questions: Computers and Technology
- C Computers and Technology Who here has a crush on jk from bts but feels more mature than him...
- B Business When Article 2 is silent on an issue of sales contract formation or interpretation and there is no state statutory law in place on that matter, which law applies?...
- B Biology Calculate the free energy change (AG) for a reaction A - Pif A has a free energy of 2 kcal/mol and P has a free energy of 1.2 kcal/mol....
Ответ:
def identiSubstring(S):
n = len(S)
inst = ""
count= 0
for Len in range(1,n+1):
for i in range(n-Len+1):
for k in range(i,i + Len):
inst =inst+S[k]
if(len(set(inst)) == 1):
count = count + 1
inst = ""
return count
S = input("Enter a string: ")
if(len(S)>=1 and len(S)<=100):
print("There are "+str(identiSubstring(S.lower()))+" possible occurrences")
else:
print("Length is invalid")
Explanation:
This line defines the required function
def identiSubstring(S):
This calculates the length of string S
n = len(S)
This initializes an instance of the required string to an empty string
inst = ""
This initializes count to 0
count= 0
This following iterations iterate through the length of the string
for Len in range(1,n+1):
for i in range(n-Len+1):
for k in range(i,i + Len):
This gets an instance of string S
inst =inst+S[k]
This checks if the characters of the instance are identical
if(len(set(inst)) == 1):
If yes, the counter is incremented by 1
count = count + 1
This instance is reset back to an empty string
inst = ""
This returns the number of instances of the substring
return count
The main begins here
This prompt user for a string
S = input("Enter a string: ")
This checks for valid length
if(len(S)>=1 and len(S)<=100):
If length is between 1 and 100 (inclusive), this calls the identiSubstring function
print("There are "+str(identiSubstring(S.lower()))+" possible occurrences")
If otherwise
else:
This prints invalid length
print("Length is invalid")
See attachment