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

What are header files in c programming?

647


4. main() { int c=- -2; printf("c=%d",c); }

1361


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

590


what is the function of pragma directive in c?

611


What is the best way of making my program efficient?

559






What standard functions are available to manipulate strings?

552


What are identifiers c?

557


Is there a way to compare two structure variables?

608


How can you tell whether two strings are the same?

818


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

1791


What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers

667


Can you please explain the difference between malloc() and calloc() function?

609


Tell me the use of bit field in c language?

616


What does node * mean?

700


What will be your course of action for a push operation?

655