<<

DATA

FIRST CHAPTER Content

▪ What is DSA?

▪ Example of DSA.

▪ Classification of Structure.

▪ Top-down And Bottom-up approach.

▪ Difference Between Top-Down And Bottom Up approach.

▪ Advantages and Disadvantages Of Structured Programming.

▪ Concept of variables and Datatypes.

▪ Rules for naming a variable.

▪ What Is Pointer?

▪ What Is Constant Pointer? Algorithm?

In science, a data structure is a particular way of organizing and storing data in a computer so that it can be accessed and modified efficiently . More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data. Example of Data Structure:-

• An array is a number of elements in a specific order, typically all of the same type. Elements are accessed using an index to specify which element is required (Depending on the language, individual elements may either all be forced to be the same type, or may be of almost any type). Typical implementations allocate contiguous memory words for the elements of arrays (but this is not always a necessity). Arrays may be fixed- length or resizable. • A class is a data structure that contains data fields, like a record, as well as various methods which operate on the contents of the record. In the context of object-oriented programming, records are known as plain old data to distinguish them from classes. Classification Of Data Structure Top Down Approch Bottom Up approch

Concept of Data Types:-

:- Is associated with the variable to hold the particular in lang. there are mainly Four datatype , they are:- ▪ Int ▪ Char ▪ Float ▪ Double

▪ Constants:- Are also called as literals constants are these that do not change value during the execution of programme. There are Three types of constants and they are as follows:- ▪ constant ▪ Numeric constant ▪ String constant

▪ Variables:- Are also called as . Variable can be a name of object . the value of variable can be changed during the execution of program. Rules For Naming A variable?

▪ Variable should be declare with the datatype. ▪ Variable can be a combo of alphabets , digits & with ( _ ). ▪ First, letter of variable should be letter or underscore. ▪ First, letter cannot be a digit. ▪ Keyword cannot be used as a variable. What Is Pointer?

In , a pointer is a object, whose value refers to (or "points to") another value stored elsewhere in the using its . A pointerreferences a location in memory, and obtaining the value stored at that location is known as dereferencing the pointer. Pointer Constant?

A constant pointer is a pointer that cannot change the address its holding. In other words, we can say that once a constant pointer points to a variable then it cannot point to any other variable.

A Pointer constant is declared as: const int *ptr; (the location of ‘const’ makes the pointer ‘ptr’ as a pointer to constant.