Data structures introduction tutorial

Bodhak data structures tutorial in this chapter we will discuss Intro to Data Structures. Data is a set of elementary items.

“The data structures deal with the study of how the data is organized in the memory, how efficiently it can be retrieved and manipulated and the possible ways in which different data items are logically related”.

 

data structures introduction tutorial

They can be classified into:

Primitive data structures

Non-primitive data structure.

Non-primitive data structures:

These are data structures that we cannot manipulate directly by machine instructions. Arrays, linked lists, files etc., are some of the non-primitive data structures and are classified into linear data structures and

Arrays, linked lists, files etc., are some of the non-primitive data structures and are classified into linear data structures and non-linear data structures.

An abstract data type is a data structure and a collection of functions or procedures which operate on the data structure

An Example: Collections

Programs often deal with collections of items.

We can organize these collections in many ways and use many different program structures to represent them, yet, from an abstract point of view, there will be a few common operations on any collection.

These might include:

createCreate a new collection
addAdd an item to a collection
deleteDelete an item from a collection
findFind an item matching some criterion in the collection
destroyDestroy the collection

Lifetime Of A Variable

The variable is a runtime concept

period of time during which a variable has memory space associated with it

Variable begins with the allocation of space.

Variable ends with deallocation of space.

üthree categories of “lifetime”

static –  start to end of program execution

automatic (stack) – start to end of declaring function’s execution

heap – the variable declared dynamic at runtime, and also de-allocated dynamically at runtime.