• Data Structure - Tutorials

    Introduction Of Linear And Non Linear Data Structure

    Linear data structure: A data structure is said to be linear if its data item form a linear sequence. Examples of the linear data structure are: (a) Array (b) Linked List (c) Stack (d) Queue Array: An array is a collection of data elements of same datatype. The elements of the array are stored in consecutive memory locations. Arrays are declared using the following syntax: type name[size]; memory representation: Stack: A stack is a linear list in which insertion and deletion operations are performed at only one end of the list.  It follows LIFO structure. Queue: A queue is a…

  • Data Structure - Tutorials

    Basic Introduction Of Data Structures

    Data structures: A data structure is a way of organizing data items such that data items can be accessed efficiently. Or A data structure is a way of organizing data items that considers not only the items stored, but also their relationship to each other. Types of data Structure: Primitive data structure: The data structures that are directly operated by machine level instructions are known as primitive data structures. Following are the primitive data structure: (a) Integer : – Integer is a represent numbers. – The set of integer is: {…………-(n+1), -n,…,-2,-1,0,1,2,……..,n,n+1,………} (b) Real: – The number having decimal point…

  • Java

    Write a java program which generates student grade report in console. Take student roll number and marks (out of 100) of 5 courses from user. Calculate the percentage and display grade of the student. Use appropriate control statements.

    The below program shows how to use array and store student’s details and fetch details. Here we are using for each loop which is used to iterate throughout entire array element. Example import java.util.Scanner; class FindGrade { //get roll number and marks of student and calculate percentage and grade public static void main(String args[]) { int sub[],i,total=0; float per=0.0f; Scanner sc; String rNo; sub=new int[5]; sc=new Scanner(System.in); System.out.println("Enter Roll Number"); rNo=sc.next(); for(i=0;i<5;i++) { System.out.println("Enter Marks Of Subject "+(i+1)); sub[i]=sc.nextInt(); total=total+sub[i]; } per=total*100/500; System.out.println("\n***** Details Of Student *****\n"); System.out.println("\nRoll Number "+rNo); System.out.println("Total Marks Gained Is "+total); System.out.println("Percentage Gained Is "+per); if(per>90)…