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
Explain what is the advantage of a random access file?
How can you read a directory in a C program?
What does double pointer mean in c?
What is the difference between %d and %i?
What does stand for?
Apart from dennis ritchie who the other person who contributed in design of c language.
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
What does malloc () calloc () realloc () free () do?
Why pointers are used in c?
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
Is printf a keyword?
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
How can you check to see whether a symbol is defined?
How do I get an accurate error status return from system on ms-dos?
Why do we use pointer to pointer in c?