Data Structure Tutorial

Programming Approach

Flow Chart

Define Data Structure

DS Problem Solving


DS Data Types

DS Arrays

DS Stack

DS Queue

Number System

Spare matrix



Application of Stack

DS Linked List

DS Functions

DS Tree

DS Graph


Exercise Searching


Hash Table

DS Questions

Modular Programming

This approach towards programming requires that long programs should be divided into smaller programs or modules that can be designed coded and debugged separately with minimum amount of interaction.

Top Down Approach
Top down approaches emphasize planning and a complete understanding of the system. It is essential that no coding can begin until a sufficient level of detail has been reached in the design of at least some part of the system. The top-up approach is done by attaching the stubs in place of the module. However, this delays testing of the ultimate functional units of a system until significant design is complete. Top up design was promoted in 1970’s by IBM researchers Harlan Mills and Nucleus Wirth.

Advantages of Top-down programming:
a) Separating the low level work from the higher level abstractions leads to a modular design.
b) Modular design means development can be self contained
c) Having skeleton code illustrates clearly how low level module integrate
d) Fewer operation errors
e) Much less time consuming
f) Very optimized way of processing
g) Easy to maintain.

Bottom UpApproach
Bottom up emphasizes coding and early testing, which can begin as soon as the first module has been specified. This approach runs the risk that modules may be coded without a clear idea of how they link to other parts of the system and such linking may not be easy. Reusability of code is one of the main benefits of the bottom up approach.
In bottom approach the base elements are linked together to form larger subsystems, which are linked sometimes in many levels till a complete top-level system is formed.

Structured Programming

It is an approach for writing programs which when adopted, makes the logical-steps of the program simple and much more understandable. So that not only the writer of the program understands it but it is easy for other programmers to follow the logic.

Steps followed for structured approach
1. Each process should be represented independently.
2. Control Constructs should be restricted to following three constructs described below.
a) Sequential
b) Decision
c) Loop

1. Clarity: Structured Programming generally have clarity and more logical. They are easy to follow.
2. Productivity: This helps other and the programmer in understanding the logic in the later part of the development life cycle.
3. Maintenance: The Clarity and modularity of a Structured Design helps in finding the bug in the program or redesigning the program during the maintenance phase.

1. Inefficiency: Sometimes Structured approach requests more code to be written.
2. Difficulty: To achieve this is very difficult.

There are two common philosophies that exist are as follows:
1.Top Down
2.Bottom Up

Top Down Top down design basically an approach follows the following steps:
1.Overall aspect of system is studied.
2.Complete task is broken down into independent sub modules.
3.Process of breaking is related till one obtains modules, which are small enough to grasp mentally and code at one sitting in a straightforward uncomplicated manner.
4.In the hierarchy of modules, development starts from the top and follows till bottom.

Bottom Up In this approach one first visualizes a typical system design and decided by experience, intuition or some analysis that which parts of the design are most difficult and essential ones. In this approach each module is coded as soon as its design is fixed.
This type of approach is mostly followed while developing the software for operating systems, where one has to first develop the software for handling primitive calls. Using these programs upper layers is developed and using these layers next higher level software’s are developed.

In computers debugging is the process of locating and fixing errors in computer program code or a piece of electronic hardware device. Debugging is a necessary process in almost any new software or hardware development process in a program. Debugging tends to be harder when various subsystems are tightly coupled as changes in one may cause bugs to emerge in another.

Program testing guides:
For most programs it is practically impossible to prove that the program is correct on all inputs. Instead you must try to convince a doubter that is mostly work right by testing the program on various inputs and documenting that you have done. This documentation is called test plan and you must provide one with each program.