Data Structures

Data Structures

C Program for Depth First Binary Tree Search without using Recursion

C Program for Depth First Binary Tree Search without using Recursion : The following C program performs a Depth First Search traversal. Depth-first search (DFS) is an algorithm for traversing or searching a tree, tree structure or graph. The concept of backtracking is used in DFS. In this program we are performing DFS on a binary tree. In DFS,...

C Program to Traverse the Tree without using Recursion

C Program to Traverse the Tree without using Recursion : This C program will traverse the tree without using Recursion. The following C program, using iteration, searches for a given node in a tree. The tree we have used is the binary search tree. A binary search tree follows a concept of the nodes whose numbers are lesser than...

C Program to Store Information Using Structures with Dynamic Memory Allocation

C Program to Store Information Using Structures with Dynamic Memory Allocation : This program asks user to store the value of n and allocates the memory for the n structure variable dynamically using malloc() function. C Program to Store Information Using Structures with Dynamic Memory Allocation : #include <stdio.h> #include<stdlib.h> struct name { int a; char c; }; int main(){ ...

C Program to Store Information of a Student Using Structure

In this program, a structure(student) is created which contains name, roll and marks as its data member. Then, a structure variable(s) is created. Then, data (name, roll and marks) is taken from user and stored in data members of structure variable s. Finally, the data entered by user is displayed. C Program to Store Information of a Student Using Structure: #include...

C Program to print strings in alphabetical order

C Program to print strings in alphabetical order or Lexicographical order : As we all know there are several ways to sort strings alphabetically but using arrays is the easiest.  Ordering Strings into alphabetical form is also referred as Lexicographical ordering of strings. Today we will learn how to sort or print strings in alphabetical order using C programming. ...

C Program to Concatenate two Strings using Arrays

C Program to Concatenate two Strings using Arrays : There are lot of ways of concatenating strings in C programming, also there is standard function in C "strcat" to concatenate the strings. But how to concatenate strings without using standard String function. Today we will learn how to concatenate two strings using arrays. Actually concept is quite easy, we...