Posts

Showing posts from June, 2021

Array Declaration

Image
Array Declaration Declaration is an important process for a variable so that the compiler will know what kind of variable , containing which type of value and of what size is required by the user .         Therefore , an array is also declared as other variables. In declaration we provides the name and the size of array. Syntax of array declaration is as follows : -            Int - N  [a]; Int : Type of Data N : Name of Variable [a] : Size of Length Type of Data or data type defines the type or category of element's can be stored in the arrays . Like - int type only store number's, Name (n) specifies the name of array or variable. [a] Size or Length specifies the capacity of storing elements. Like [10] means it can only store 10 elements. For example -                  int N [10]. In the above example, the name of array is N and it can accept only 10 integer (number) type of el...

Arrays and String

Image
Arrays Arrays and String Arrays are the collection of homogeneous elements such that the elements are stored  in consecutive memory locations or we can say that the "Array is a collection of variables of the same type of data that are reffered by a common name , These elements are referenced respectively by an index set consisting of 'n'  consecutive numbers.             Size of array is the number 'n'  of elements. The index set consisting of consecutive Integers 1,2,3...................., n. The lowest address of an array corresponds to the first element and the highest address to the last element. The size or length can be obtained as follows :-                       length = in - lb + 1 Where ' ub' is the upper bound and it refers to the largest index  while 'lb' is the lower bound and it refers to the smallest index of an array respectively. When 'lb' is equal to 1 then in this ...

Data Structure and C

Image
  Data Structure and C A C programmer can think of the C language as defining a new machine with  its own capabilities , data types and types and operations . the user can state a problem solution in terms of the more useful C constructers. Thus , problem can be solved more easily because a larger set of tools is available in C. The study of data structure therefore involves two complementary goals. The first goal is to identify  and develop useful mathematical entities and operations and to determine what classes of problems  can be solved by using these entities and operations  The second goal is to determine representation for those abstract entities and to implement the abstract operations on these concrete  representation . The first of these goals views a high-level data types as a tool that can be used to solve other problems and the second views the implementation of such a data type as a problem to be solved using already existing data types . In d...

Description of Various Data Structures

Image
Description Of Various Data Structures : 1. Arrays :            An array can be defined as a set of finite numbe r of homogeneous elements  or data items. It means an array can contain one type only, either all Integers, all floating-point numbers or all characters. Declaration of arrays is as follows :-                          int a[10]; Where int specifies the data types or type of elements array stores. "a" is the name of arry and the number specified inside the square brackets is the number of elements an array can store. This is also called size or length of array. Following are some of the points to be remembered about arrays - 1. The individual elements of an array can be accessed by specifying name of the array , followed by index or subscript (which is an integer number specifying the location of element in the array) inside square brackets.      For example to ac...

Operations on Data Structure

Image
  OPERATIONS ON DATA STRUCTURES The most commonly used operations on Data Structure are broadly categorized as follows :- 1. Create :                             This operation results in reserving memory for the program elements. This can be done by declaring statement. The creation of data structure may take  place either during compile time or during run- time. 2. Destroy :                               This operation destroys the memory space allocated for the specified data structure. Free () of C language is used for these operations. 3. Selection :  This operation deals with accessing a particular data within a Data Structure. 4.Update : This operation updates or modifies the Data in the Data Structure. Probably new data may be  entered or previously stored data may be entered or previously stored data may be deleted....