BT0065-C Programming and Data Structures

Dear students get fully solved assignments

Send your semester & Specialization name to our mail id :

 

“ help.mbaassignments@gmail.com ”

or

Call us at : 08263069601

(Prefer mailing. Call in emergency )

 

 

FALL 2014 – Assignment

 

PROGRAM B.Sc IT
SEMESTER FIRST
SUBJECT CODE & NAME BT0065-C Programming and Data Structures
CREDIT 3
BK ID B0949
MAX.MARKS 60

 

Note – Answer all questions. Each question is followed by evaluation scheme.

 

1 Write an algorithm to check whether a given number is even or odd number and after that draw the flowchart.

Answer: Algorithms

A sequential solution of any program that written in human language,called algorithm.

Algorithm is first step of the solution process, after the analysis of problem, programmer write the algorithm of that problem.

Example of Algorithms:

 

Q.2 Explain the structure of the C program.

Answer: – Structure of the C program:- Structure is the collection of variables of different types under a single name for better handling. For example: You want to store the information about person about his/her name, citizenship number and salary. You can create these information separately but, better approach will be collection of these information under single name because all these information are related to person.

 

 

3 What is structure? What is its importance? Explain with an example how to declare and initialize structure.

Answer:- A structure is a user defined data type. You have the ability to define a new type of data considerably more complex than the types we have been using. A structure is a combination of several different previously defined data types, including other structures we have defined. An easy to understand definition is, a structure is a grouping of related data in a way convenient to the programmer or user of the program.

An initializer for a structure is a brace-enclosed comma-separated list of values. An initializer is preceded by an equal sign (=). In the absence of designations, memory for structure members is allocated in the order declared, and memory address are assigned in increasing order, with the first component starting at the beginning address of the structure name itself. You do not have to initialize all members of a structure. The default initializer for a

 

4 What do you mean by dynamic memory allocation? Explain the three functions for dynamic memory allocation in C language.

Answer: – Dynamic memory allocation:- Dynamic memory allocation is when an executing program requests that the operating system give it a block of main memory. The program then uses this memory for some purpose. Usually the purpose is to add a node to a data structure. In object oriented languages, dynamic memory allocation is used to get the memory for a new object.

The memory comes from above the static part of the data segment. Programs may request memory and may also return previously dynamically allocated memory. Memory may be returned whenever it is no longer needed. Memory can be returned in any order without any relation to the order in which it was allocated. The heap may develop “holes” where

Q.5 Write C program to implement stack using arrays.

Answer:- C program to implement stack using arrays:-

 

 

 

 

Q.6 What do you mean by binary tree? Explain the storage representations of binary tree.

Answer: – Binary tree:- a binary tree is a tree data structure in which each node has at most two children, which are referred to as the left child and the right child. A recursive definition using just set theory notions is that a (non-empty) binary tree is a triple (L, S, R), where L and R are binary trees or the empty set and S is a singleton set.[1] Some authors allow the binary tree to be the empty set as well.[2]

From a graph theory perspective, binary (and K-ary) trees as defined here are actually arborescences.[3] A binary tree may thus be also called a bifurcating

Dear students get fully solved assignments

Send your semester & Specialization name to our mail id :

 

“ help.mbaassignments@gmail.com ”

or

Call us at : 08263069601

(Prefer mailing. Call in emergency )

 

Leave a Reply