Friday, 7 July 2023

What is Array in Data Structure ?

 what is array data structure?

           array is a container that can hold a fixed number of items and should be of the same type.

           The following component are important terms to understand the concept of Array.

        1.Element

        2.Index


 Representation of array








Basic Operations in Array:

  1. Traverse - Print all the array elements one by one
  2. insertion - Adds an element at the given index
  3. deletion - deletes an element using the give index or by the value
  4. Search - Searches an element using the given index or by the values
  5. update - Updates an element at the give index.




Monday, 3 July 2023

What is Data Structure?

 What is Data structure?

A data structure is a storage that is used to store and organize data. 

It is a way of arranging data on a computer so that it can be accessed and updated efficiently.

There are different types of methods used to store and organized the data, they are

Main two types, 

  1.     Linear Data structure
  2.     Non – linear Data structure

Linear data structure

       Linear data structures are those in which the elements are arranged sequentially, 

and each element is connected to its previous and next elements. 






Example:

  • Array
  • Queue
  • Stack
  • Linked List
  • Non-Linear data structure

Non-linear Data Structures

Non-linear data structures are those in which the elements are not 

arranged sequentially. Instead, each element is connected to one or more other elements. 

in a way that forms a hierarchical structure.





Example:

  • Tree
  • Graph


Sunday, 2 July 2023

 

What is an Algorithm?

An algorithm is a set of instructions or steps that are used for problem-solving or to perform a computation.

 It is a well-defined, step-by-step procedure that is used to solve a problem or perform a computation.

Here is an example algorithm for converting the seed into a tree.





Step 1: Plant the seed in the soil.

Step 2: Water it regularly.

Step 3: Wait for the seed to germinate.

Step 4: Watch the seedling grow into a sapling.

Step 5: Provide support to the sapling if needed.

Step 6: Prune the sapling if needed.

Step 7:  Watch the sapling grow into a tree.

In technically,

Here is an example algorithm to add two numbers.

 Step 1: Start Step

 Step2: Declare variables num1, num2, and sum.

 Step 3: Read values num1 and num2.

Step 4: Add num1 and num2 and assign the result to the sum. sum←num1+num2

Step 5: Display the sum.

Step 6: Stop.

The sum of the two numbers program in C

#include <stdio.h>
int main() {    

    int number1, number2, sum;
   
    printf("Enter two integers: ");
    scanf("%d %d", &number1, &number2);
    sum = number1 + number2;      
    printf("The Sum of %d and  %d is %d",
number1, number2, sum);
    return 0;
}

Output:

Enter two integers: 2 8 The Sum of 2 and 8 is 10

Saturday, 1 July 2023

Home Page

 
home Page

Way To Learn website for Learning the Concept Programming

Word Basic Exercise

Exercise 1: Opening a document Show and hide the ribbon Move, show, and hide options of Quick Access toolbar Exercise 2: Cre...