Answer:
A linear search is one that scans every record/file until it discovers the value being searched for.
Binary search, on the other hand, is also known as <em>Logarithmic search</em>. It is used to locate the position of a value inside an array that has already been sorted.
The linear search will return the lowest value faster than the binary search when small arrays are involved.
This will only be feasible when the array is sorted prior.
Cheers!
Answer:
Following are the program in c language
#include <stdio.h> // header file
int main() // main method
{
char name[90]="mantasa"; // storing name
char add[90]="120 lal bangla mumbai"; // storing address
printf("\n Name:%s\nAddress:%s",name,add); // print name and address
return 0;
}
Output:
Name:mantasa
Address:120 lal bangla mumba
Explanation:
In this program we are declaring the two array of char type which will store the name and address . after that we display name and address.
Answer: Tar.
Explanation:
A chemical substance made when tobacco is burned. Tar contains most of the cancer-causing and other harmful chemicals found in tobacco smoke. When tobacco smoke is inhaled, the tar can form a sticky layer on the inside of the lungs.
Answer:
To query the access database to return a group of records with lastname starting with A, change the LastName field's criteria to A, and then click the run button in the results ribbon group of the design ribbon tab.
Explanation:
Microsoft Access is a database management software used to create, manage, and query a database. Just like a spreadsheet and in relational databases, it stores data in records (rows) and fields (columns). To output the result of a query, the run button in the design ribbon tab is clicked.
Answer:
1 void parseEmailAddress(string email, string& username, string& domain)
2 {
3 int found = email.find("@")
4 if (found > 0)
5 {
6 username = email.substr(0, found);
7 domain = email.substr(found+1, -1);
8 }
9 return;
10}
Explanation line by line:
- We define our function.
- We use an open curly bracket to tell the program that we are starting to write the function down.
- We apply the find method to the email variable that was passed by the main program. The find method tells us where is the "@" located within the email.
- We use an if statement to ensure that the value that we found is positive (The value is negative if an only if "@" is not in the email address).
- We use an open curly bracket to tell the program that we are starting to write inside the if statement.
- We apply the substr method to the email to take the username; it receives a start and an end value, this allows us to take from the beginning of the email (position 0) until the "@".
- We apply the substr method to the email to take the domain; it receives the position of the "@" character plus one to take the first letter after the "@" and a minus-one representing the last character on the email.
- We use a closing curly bracket to tell the program that the if statement has finished.
- We return nothing because we are using reference parameters, which means that the memory positions of username and domain are going to be filled by our parseEmailAddress function and the main function can access those values directly.
- We use a closing curly bracket to tell the program that the function has finished.