## What is the Heap

by Dinesh Thakur Category: Data Structure

The heap is where malloc(), calloc(), and realloc() get memory. Getting memory from the heap is much slower than getting it from the stack. On the other hand, the heap is much more flexible than the stack. Memory can be allocated at any time and deallocated in any order. Such memory isn't deallocated automatically; you have to call free().

## How can we analyse an Algorithm

by Dinesh Thakur Category: Data Structure

Analysis of Algorithms (AofA) is a field in computer science whose overall goal is an understanding of the complexity of algorithms. While an extremely large amount of research is devoted to worst-case evaluations, the focus in these pages is methods for average-case and probabilistic analysis. Properties of random strings, permutations, trees, and graphs are thus essential ingredients in the analysis of algorithms.

## Using free() Function in C

by Dinesh Thakur Category: Data Structure

The function free() is used to de-allocate the memory allocated by the functions malloc ( ), calloc ( ), etc, and return it to heap so that it can be used for other purposes. The argument of the function free ( ) is the pointer to the memory which is to be freed. The prototype of the function is as below.

## What is abstraction?

by Dinesh Thakur Category: Data Structure

1 The process of extracting common properties from particular examples. In programming, it typically means replacing the specific numbers and strings in a particular instance of a problem by variables and functions, so that the same program can solve many problems of the same kind.

## Memory Allocation Function Calloc()

by Dinesh Thakur Category: Data Structure

The function is used to allocate contiguous blocks of memory of same size during the execution of the program. So, it may be applied for creating arrays of fundamental types as well as structures. The function malloc ( ) may also be used for the same purpose. The prototype of the function calloc () is given below.

by Dinesh Thakur Category: Linked Lists

A linked list can be viewed as a group of items, each of which points to the item in its neighbourhood. An item in a linked list is known as a node. A node contains a data part and one or two pointer part which contains the address of the neighbouring nodes in the list.

## Short Note on Singly Circular Linked List

by Dinesh Thakur Category: Linked Lists

The advantage of using Circular Linked List is the last null pointer is replaced and the pointer field of the last node points to the first node, due to this circular arrangement the traversing become quite easier.

## What is Doubly Linked List

by Dinesh Thakur Category: Linked Lists

A more sophisticated kind of linked list is a doubly-linked list or a two-way linked list. In a doubly linked list, each node has two links: one pointing to the previous node and one pointing to the next node.

## Short Note on Single Linked List

by Dinesh Thakur Category: Linked Lists

A singly linked list is a linked list in which each node contains only one link field pointing the next node in the list.

## What is Circular Linked Lists

by Dinesh Thakur Category: Linked Lists

In a circularly-linked list, the first and final nodes are linked together. In another words, circularlylinked lists can be seen as having no beginning or end. To traverse a circular linked list, begin at any node and follow the list in either direction until you return to the original node.

Page 2 of 4