<u>Answer</u>:
<em>It is possible to sort data in word. For doing this, you must have content in the form of list.
</em>
<u>Explanation:</u>
<em>1. Select the text in numbered list / bulleted list
</em>
<em>2. Click on the Home tab, Paragraph group, Click on Sort. You well get a Sort Text dialog box</em>
<em>3. In the dialog box , Click Paragraph, Text, Ascending / descending. So you can change the way it sorted by using the same dialog box whenever required.
</em>
<em>
In addition to sorting text, you can sort date and also sort number.
</em>
Making guesses, as opposed to the other answers, this is the only one that forges new ideas and doing such will only lead to an illegitimate conclusion/study.
Answer:
Following are the program in the Python Programming language.
#define function
def negative_num(num_list):
#set list type variable
nlist=[]
#set the for loop
for n in num_list:
#check negative numbers
if(n<0):
#add the value of n in list
nlist.append(n)
#return list
return nlist
#set new list type variable that store list
newl=[-5,8,-6,3,-4,9,-7]
#print and call the function
print(negative_num(newl))
<u>Output</u>:
[-5, -6, -4, -7]
Explanation:
Here, we define the function "negative_num" and pass an argument "num_list" in its parameter and inside the function.
- Set new list data type variable "nlist".
- Set the for loop which iterate as the list.
- Set the if conditional statement to check the value of the list is less than 0 then, add that negative values in the variable "nlist".
- Then, return the new list.
Finally, we set a variable "newl" which store the list of negative and positive numbers then, we print and call the function.
Answer:
Check the explanation
Explanation:
Keep two iterators, i (for nuts array) and j (for bolts array).
while(i < n and j < n) {
if nuts[i] == bolts[j] {
We have a case where sizes match, output/return
}
else if nuts[i] < bolts[j] {
what this means is that the size of nut is lesser than that of bolt and we should go to the next bigger nut, i.e., i+=1
}
else {
what this means is that the size of bolt is lesser than that of nut and we should go to the next bigger bolt, i.e., j+=1
}
}
Since we go to each index in both the array only once, the algorithm take O(n) time.