The study of data structure therefore involves two complementary goals. The first goal is to identify and develop the useful mathematical entities and operations. The second goal is to determine representation for those abstract entities and to implement the abstract operations. In data structure that exit in c the array and structure, we describe the…

# Category: Data Structure

## How to Represent Stack in C – Data Structure

The Stack provides for the insertion and deletion of items, so that a stack is a dynamic, constantly changing object. #define MAXSIZE 100struct stack { int items[MAXSIZE]; int top;}; Note: If the value of s-top is 4 there are five elements on the stack i.e s.item[0], s.items[1], s.items[2], s.items[3], s.items[4] When the stack is popped,…

## Tower of Hanoi Problem (TOH) with Recursive Algorithm

TOH ( Tower of Hanoi) is a mathematical game or puzzle. It consists of 3 pegs A, B and C. N Disks of different diameters are placed on peg A so that a larger disk is always below a smaller disk. The aim is to move the N disks to peg C using peg B…

## Non-Linear Data Structure and Algorithm

The implementations of Stacks and Queues from linear data structures. They cannot represent data items possessing hierarchical relationship such as between the grandfather and his descendants and in turns their descendants and so on. We need a non-linear data structure to deal with such an application in a real-life situation. Trees and graphs are two…

## Binary Trees and It’s Different Types

A binary tree is a finite set of elements that is either empty or is partitioned into three disjoint subsets. The first subset contains a single element called the root of the tree. The other two subsets are themselves binary trees, called the left and right subtrees of the original tree. Left or right subtree…

## What is Data Structure? Why Do We Require This?

Question: What is Data Structure? Data is the basic factor entity that is utilized in calculation or manipulation. There are two different type of data numerical and alpha-numerical data and these two data type defines that the nature of data item under that goes some operations, like integer floating point data character constant and such other data items…

## Difference Between Primitive and Non-Primitive Data Types

Primitive data type: In simple terms “data type” and “primitive data type” are simply known and used as interchangeable variables. Primitive data types are predefined types of data, which are supported by the programming language. For example, integer, character, and string are all primitive data types. Non-primitive data type: Non-primitive data types are not defined by the programming language, but are instead created…