Question 1you are required to provide suitable examples of

Assignment Help Data Structure & Algorithms
Reference no: EM13349697

QUESTION 1

You are required to provide suitable examples of your own for each part of the question where appropriate

(a)(i) Define a structure?

(ii) What is a structure member?

(iii) How can structure variables be declared?

(iv) How can the members of a structure variable be assigned initial values?

(v) How can the size of a structure be determined?

(b)(i) What is a union?

(ii) How does a union differ from a structure?

(iii) How is a union member accessed?

(iv) How can a member of a union variable be assigned an initial value?

(v) Explain the rules which apply when processing unions

(c) Write down a structure which contains the following four members-

(i) an integer quantity called student_id

(ii) a 40-element character array called student_name

(iii) an integer quantity called phone_number

(iv) a floating-point quantity called marks

Include the user defined data type 'student' within the definition

QUESTION 2

(a)(i) What is the primary advantage when using data files in programs?

(ii) Describe how data files can be categorized in C

(iii) What is the purpose of a buffer area when working with data files?

(iv) Explain how the buffer area is defined?

(b)(i) What is a stream pointer?

(ii) What is the relationship between a stream pointer and a buffer area?

(iii) Explain the process of opening a data file in C

(c) Read the sample C program given below and answer the questions based on it

#include <stdio.h>

main( ){

FILE *opt1, *opt2; char student_name[30];

opt1 = fopen("list.old", "r");

opt2 = fopen("list.new", "w")

......................

fclose(opt1);

fclose(opt2);

}

Write down appropriate statements to perform the following tasks-

(i) Read the string represented by student_name from the file list.old

(ii) Display the result on the screen

(iii) Enter an updated string

(iv) Write the new string to the data file list.new

QUESTION 3

(a) Give two advantages of using 'Linked List' instead of 'arrays' in programs

(b) Write down the definition of a 'linked list' to contain the following-

(i) course_id of datatype integer

(ii) character array course_name of size 40

(iii) floating-point variables duration and fees

(iv) pointer variable next of the same structure type

(v) Include the tag course within the definition

(c)(i) Declare two variables of type course

(ii) Write down appropriate statement(s) to allocate memory to the first node

(d) Write down the function to create the linked list with the nodes declared. This function must also allow the user to terminate the input

QUESTION 4

(a) Explain the following sorting techniques using appropriate algorithms-

(i) selection sort

(ii) bubble sort

(b) Explain how 'linear search' differs from 'binary search' using suitable algorithms

Reference no: EM13349697

Questions Cloud

Question1a puck of mass m1 760 g and radius r1 440 cm : question1a puck of mass m1 76.0 g and radius r1 4.40 cm glides across an air table at a speed of 1.50 ms. it makes a
Question the diamond freight company has been provided a : question the diamond freight company has been provided a seven-year contract to haul munitions for the government.
Questionsome of properties of a diatomic molecule no can be : questionsome of properties of a diatomic molecule no can be described in terms of a effortless model in which two atoms
Question on january 1 2015 mcdaniel company issued a 5-year : question on january 1 2015 mcdaniel company issued a 5-year 1000000 bond with stated interest rate of 10. interests
Question 1you are required to provide suitable examples of : question 1you are required to provide suitable examples of your own for each part of the question where appropriateai
Question1a lunar landing craft approaches the moonrsquos : question1a lunar landing craft approaches the moonrsquos surface. suppose that one-third of itsnbspweight is fuel that
Question1consider mass and a frictionless ramp the mass is : question1consider mass and a frictionless ramp. the mass is pushednbspupward with some initial velocity. since of
Question 1a explain the meaning of each of the following : question 1a explain the meaning of each of the following pointer declarations-i float a -0.137float pa ampaii double
Question1train springnbspa number of train stations have : question1train springnbspa number of train stations have large horizontal springs at the ends of the tracks. these are

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd