Define a structure to store the record of library. The
record must consist of at least following fields: Title,
Author, Edition, Price, Publisher, and Category.
-Define functions authorSearch ( ), TitleSearch ( ) and
CategorySearch ( ) to search a book with respect to author,
title and category. [There can be more than one book,
written by one author, in one category]
Answer Posted / sharmaak
Solution is simple. Have a library data structure as a struct containing all the fields
struct library
{
char title[30];
char author[30];
char edition[30];
char price[30];
char publisher[30];
char category[30];
};
But have separate data structure which make different fields searchable in log(n) time.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What was noalias and what ever happened to it?
What is time null in c?
Explain pointer. What are function pointers in C?
Simplify the program segment if X = B then C ← true else C ← false
Is there a built-in function in C that can be used for sorting data?
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above
What is the difference between ++a and a++?
Explain how many levels deep can include files be nested?
What would be an example of a structure analogous to structure c?
Write a program to swap two numbers without using third variable?
Do pointers store the address of value or the actual value of a variable?
When should structures be passed by values or by references?
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
Who invented bcpl language?
Where we use clrscr in c?