It does not matter how slowly you go as long as you do not stop.
--Your friends at LectureNotes

Note for Data Structure using C - DS By JNTU Heroes

  • Data Structure using C - DS
  • Note
  • Jawaharlal Nehru Technological University Anantapur (JNTU) College of Engineering (CEP), Pulivendula, Pulivendula, Andhra Pradesh, India - JNTUACEP
  • 10 Topics
  • 64 Offline Downloads
  • Uploaded 1 year ago
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-1

Smartzmail.com C Programming & Data Structures UNIT-1 Introduction to Computers: A computer system consists of hardware and software. Computer hardware is the collection of physical elements that comprise a computer system. Computer software is a collection of computer programs and related data that provides the instructions for a computer what to do and how to do it. Software refers to one or more computer programs and data held in the storage of the computer for some purposes. Basically computer software is of three main types 1. Operating System The Operating System (OS) is an interface between the compute software and hardware. The most popular and latest operating systems include Windows XP, Mac, UNIX, Linux, Windows Vista, etc. 2. Application Software The application software is widely used for accomplishment of specific and precise tasks which is a step ahead than the basic operations or running of the computer system. The application software includes printing documents, and permitting access to internet for web and video conferencing activities. The Application software indirectly does the interaction with the machine to perform all these functions. 3. System Software System software directly interacts with computer hardware. Some of the examples are the device drivers for CPU, Motherboard, Mouse, Printer, Keyboard, etc. The system software takes the responsibility of control, integration and managing individual hardware machine of the computer. Computing Environment: Computing Environment is a collection of computers / machines, software, and networks that support the processing and exchange of electronic information meant to support various types of computing solutions. Types of Computing Environments:         Personal Computing Environment Client Server Environment   Time sharing Environment  Distributed Environment 1 1 Smartzmail.com

Text from page-2

Smartzmail.com C Programming & Data Structures Algorithm: An algorithm is a description of a procedure which terminates with a result. Algorithm is a step-by-step method of solving a problem. Properties of an Algorithm: 1) Finiteness: - An algorithm terminates after a finite numbers of steps. 2) Definiteness: - Each step in algorithm is unambiguous. This means that the action specified by the step cannot be interpreted (explain the meaning of) in multiple ways & can be performed without any confusion. 3) Input: - An algorithm accepts zero or more inputs 4) Output:- An algorithm should produce at least one output. 5) Effectiveness: - It consists of basic instructions that are realizable. This means that the instructions can be performed by using the given inputs in a finite amount of time. Flowchart: A flowchart is a graphical or pictorial representation of an algorithm. Each step in the process is represented by a different symbol and contains a short description of the process step. The flow chart symbols are linked together with arrows showing the process flow direction. Some common flowcharting symbols are listed below. Terminator Process Decision Purpose An oval flow chart shape indicating the start or end of the process. A rectangular flow chart shape indicating a normal process flow step. A diamond flow chart shape indication a branch in the process flow. Connector A small, labeled, circular flow chart shape used to indicate a jump in the process flow. Data A parallelogram that indicates data input or output (I/O) for a process. 2 Symbol 2

Text from page-3

Smartzmail.com C Programming & Data Structures Program Development Steps: 1. Statement of Problem a) Working with existing system and using proper questionnaire, the problem should be explained clearly. b) What inputs are available, what outputs are required and what is needed for creating workable solution, should be understood clearly. 2. Analysis a) The method of solutions to solve the problem can be identified. b) We also judge that which method gives best results among different methods of solution. 3. Design a) Algorithms and flow charts will be prepared. b) Focus on data, architecture, user interfaces and program components. 4. Implementation The algorithms and flow charts developed in the previous steps are converted into actual programs in the high level languages like C. a. Compilation The process of translating the program into machine code is called as Compilation. Syntactic errors are found quickly at the time of compiling the program. These errors occur due to the usage of wrong syntaxes for the statements. Eg: x=a*y+b There is a syntax error in this statement, since, each and every statement in C language ends with a semicolon (;). b. Execution The next step is Program execution. In this phase, we may encounter two types of errors. Runtime Errors: these errors occur during the execution of the program and terminate the program abnormally. Logical Errors: these errors occur due to incorrect usage of the instructions in the program. These errors are neither detected during compilation or execution nor cause any stoppage to the program execution but produces incorrect output. 3 Smartzmail.com 3

Text from page-4

Smartzmail.com C Programming & Data Structures General Structure of a C program: /* Documentation section */ /* Link section */ /* Definition section */ /* Global declaration section */ main() { Declaration part Executable part (statements) } /* Sub-program section */           The documentation section is used for displaying any information about the program like the purpose of the program, name of the author, date and time written etc, and this section should be enclosed within comment lines. The statements in the documentation section are ignored by the compiler. The link section consists of the inclusion of header files. The definition section consists of macro definitions, defining constants etc,.   Anything declared in the global  declaration section is accessible throughout the program, i.e. accessible to all the functions in the program. main() function is mandatory for any program and it includes two parts, the declaration part and the executable part.   The last section, i.e. sub-program section is optional and used when we require including user defined functions in the program. 4 Smartzmail.com 4

Lecture Notes