1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
never [62]
2 years ago
5

What special case exists when managing linked lists?

Computers and Technology
1 answer:
tiny-mole [99]2 years ago
6 0

Explanation:

The special case that exists in linked list when we are managing them is when we are dealing with the first element of the list.

When we create a linked list we create a first node separately.

If we delete or add element in front of the first element we have to carefully handle that case.

Hence the special case is when we are dealing with the first element of the list.

You might be interested in
Write a function maxTemp which takes a filename as string argument and returns the maximum temperature as float type for the wee
Alenkinab [10]

Answer:

#section 1

def maxTemp(filename):

   import pathlib

   f = pathlib.Path(filename)

   f.exists()

   if f.exists():

       f = open(filename, "r")

#section 2

       next(f)

       res = [int(sub.split(',')[1]) for sub in f]

       maxdata = (res[0])

       for i in range(len(res)-1):

           if maxdata < res[i]:

               maxdata = res[i]

       

       index = res.index(maxdata)

       f.close()

 #section 3  

       li = []  

       a = open(filename, "r")

       for line in a:

           line = line.strip()

           li.append(line)

   

       

       a.close()

       return (li[index+1])

   else:

       return -1

print(maxTemp("new.csv"))

Explanation:

#section 1:

The function maxTemp is defined. We import pathlib in other to check if the file exists, if it does we carry on with opening the file and if it doesn't the program returns -1.

#section 2:

We start splitting the sub-lists from the second line i.e <em>next(f)</em>. For each line we take the second index element and convert it to an integer.

<em>res = [int(sub.split(',')[1]) for sub in f] </em>

The maximum number is gotten by using the if statement to compare all elements in the list.  The index of the maximum item in the list is collected.

the file is then closed.

#section 3  :

The file is re-opened and all the lines are striped and passed into a new list and the index recovered from section 2, is used to get the day with the highest temperature and the line is returned.

8 0
3 years ago
What will be the results of executing the following statements? x.setEditable(true); x.setText("Tiny Tim"); a. The text field x
maxonik [38]

Answer:

Option B: The text field x will have the value "Tiny Tim" and the user will be able to change its value.

Explanation:

  • The first statement say:  x.setEditable(true);

It will only change the property of the text present in x to editable. This means that whenever the text value needs to change the user can edit it.

  • The second statement say:   x.setText("Tiny Tim");

It will put the text "Tiny Tim" into the attribute x and present it as the output or result.

6 0
3 years ago
Suppose you have the following declaration.char[] nameList = new char[100];Which of the following range is valid for the index o
VMariaS [17]

4. Only (ii)

<u>Explanation:</u>

The declaration of the array can be of two types:

1. int a[100];

2. int[] a = new int[100];

The general thing about an array is that whenever we want to undergo traversal in an array, we always have to start from the 0th position as the size of the array may be a whole number (let us say 10). So, to undergo traversal in an array, we start from 0 to n-1 (in this case 9) such that it covers the size of the array.

The size of an array can be finite or infinite. The general rule is it starts from 0 to n-1 where n is the size of the array. In the above example, the range of the index of the array will be 0 through 100 and not 1 through 100.

4 0
3 years ago
Def pig_latin(word): """ ------------------------------------------------------- Converts a word to Pig Latin. The conversion is
Virty [35]

def pig_latin(word):

   if word[0].lower() in 'aeiou':

       word = word + 'way'

   else:

       t=''

       for x in range(len(word)):

           if word[x].lower() in 'aeiou':

               break

           if word[x].lower() == 'y' and x>0:

               break

           else:

               t+=word[x].lower()

       if word[0].isupper():

           word = word[len(t):]+word[:len(t)].lower()+'ay'

           word = word.title()

       else:

           word = word[len(t):]+word[:len(t)].lower()+'ay'

   return word

word = 'test'

pl = pig_latin(word)

print(pl)

I wrote my code in python 3.8. I hope this helps.

5 0
2 years ago
MULTI SELECTION
GaryK [48]

Answer:

A. Click on the Print icon at the top of the screen

Explanation:

8 0
2 years ago
Other questions:
  • Which type of architecture places a firewall in front of the VPN to protect it from Internet-based attacks as well as behind a f
    6·1 answer
  • The acronym is used to define the process that allows multiple devices to share a single routable ip address.
    6·1 answer
  • What Software is used to play,create, and modify audio and video files
    7·2 answers
  • When transporting data from real-time applications, such as streaming audio and video, which field in the ipv4 header can be use
    14·1 answer
  • Write a loop that continually asks the user what pets the user has, until the user enters "rock", in which case the loop ends. I
    12·1 answer
  • The entire presentation can be seen at a time in __________
    5·1 answer
  • Enables businesses and consumers to share data or use software applications directly from a remote server over the Internet or w
    6·1 answer
  • How many pieces can be connected on to a to an SPS​
    11·1 answer
  • Write a function called no_you_pick. no_you_pick should have two parameters. The first parameter is a dictionary where the keys
    5·1 answer
  • When writing a function or a formula in a spreadsheet,what is the first u should do​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!