Skip to main content

Data Structure and Programming

 

A data structure is any data representation and its associated operations. Even an integer or floating point number stored on the computer can be viewed as a simple data structure.

Data structures mainly specifies the following four things:

  • Organization of data.
  • Accessing methods.
  • Degree of association: linear or non-linear.
  • Processing methods.

When selecting a data structure to solve a problem, we should follow these steps:

  • Analyze the problem to determine the basic operations that must be supported. Examples of basic operations include inserting a data item into the data structure, deleting a data item from the data structure, and finding a specified data item.
  • Quantify the resource constraints for each operation.
  • Select the data structure that meets these requirements.

This three-step approach to selecting a data structure operationalizes a data centered view of the design process.

A solution is said to be efficient if it solves the problem within the required resource constraints. Examples of resource constraints include the total space available to store the data - possibly divided into separate main memory and disk space constraints - and the time allowed to perform each subtask.


The cost of a solution is the amount of resources that the solution consumes. Each data structure has associated costs and benefits. In practise, it is hardly ever true that one data structure is better than another for use in all situations. A data structure requires a certain amount of space for each data item it stores, a certain amount of time to perform a single basic operation, and a certain amount of programming effort.


Prev Next

Programming

  • Sequence of precise instructions that we gave to compiler to perform a specific task.
  • Compiler compiles the source code.
  • Processor executes the code.

Linting

Linting is the process of running a program that will analyze code for potential errors such as:

  1. Programming errors
  2. Bugs
  3. Stylistic errors
  4. Suspicious constructs
  5. Syntax errors

Know about C

  • C was invented to develop Unix operating system to overcome compatibility with different hardware platforms.
  • C is a procedural language. Procedural language is also called Imperative language.
Prev Next

Comments