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


Please Help Members By Posting Answers For Below Questions

Explain what is the advantage of a random access file?

663


How can you read a directory in a C program?

649


What does double pointer mean in c?

576


What is the difference between %d and %i?

595


What does stand for?

593






Apart from dennis ritchie who the other person who contributed in design of c language.

807


The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration

630


What does malloc () calloc () realloc () free () do?

559


Why pointers are used in c?

582


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

623


Is printf a keyword?

755


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

935


How can you check to see whether a symbol is defined?

589


How do I get an accurate error status return from system on ms-dos?

647


Why do we use pointer to pointer in c?

595