Index Data Structures Using "C": S.No Date Program Description Page No
Index Data Structures Using "C": S.No Date Program Description Page No
Index Data Structures Using "C": S.No Date Program Description Page No
Stack operation
Algorithm:
Step: 1 Start the program
Step: 2 Declare the variables
Step: 3 Create functions called push ( ), pop( ) and print stack ( ).
Step: 4 Get the choice like push, pop, view, and exit.
Step: 5 In the push function, get the range of the stack and read the values to the stack
range.
Step: 6 Push the values into the stack
Step: 7 In the case of print stack, the remaining items are displayed after push and pop
Step: 8 Save the programe
Step: 9 Stop the process.
Inference: From the above programe we came to know about the concept of stack
operation.
Queue Operation
Aim: Write a programe to create a queue and delete and element from queue
Algorithm:
Step: 1: Start the programe
Step: 2: Declare the variable and initialize front=0, rear=0 and get the range
Step: 3: Read the values for queue using the array q[10] by incrementing the rear values
until rear<n
Step: 4: Assign the address if q[] array to the pointer array ptr[] in a for loop
Step: 5: process the operation like add, delete, and list.
Inference: From the above program, we came to know about the concept of queue
operation.
Bubble sort
Aim: Write a programe to sort the given number using Bubble sort.
Algorithm:
Step: 1: Start the program
Step: 2: Declare the values for given range of value
Step: 3: Create a function called bubble sort
Step: 4: Get the range for the number, which is to be sorted
Step: 5: Read the values for the range
Step: 6: Call the bubble sort function
Step: 7: Display the sorted list in table
Step: 8: Repeat the process
Step: 9: Stop the process
Inference: From the above program, we came to know about the concept of Bubble sort
Quick sort
Inference: From the above program, we came to know about the concept of Quick
sorting.
Binary Search
Aim: write a program to create a program for searching an element in the binary tree
Algorithm:
Step: 1: Start the program
Step: 2: Declare the values for given range of value
Step: 3: Get the range
Step: 4: Read the values for the range
Step: 5: Get the item to be search
Step: 6: Compare the upper bound & lower bound and heck the
searching element
Step: 7: If the mid value is equal to the searching item than print the result as true
Step: 8: Save the programe
Step: 9: Stop the Programe
Inference: From the above program, we came to know about the concept of Binary
searching.
Linear Search
Algorithm:
Step: 1: Start the programe
Step: 2: Declare the variables
Step: 3: enter the elements in the array
Step: 4: The number to be searched for in entered key
Step: 5: The key is compared with each element in the arry and it found its position and
value is displayed on screen if not found, number in not found, message is
displayed on the screen.
Inference: From the above program, we came to know about the concept of Linear
searching.
Linux
Arithmetic Operation
Algorithm:
Step: 1: Start the programe
Step: 2: Read the value for performing the arithmetic operation
Step: 3: Read the operator as the input of our choice
Step: 4: In case statement depending upon the operator perform the arithmetic operation,
such as addition, subtraction, multiplication and division
Inference: From the above program, we came to know about the concept of arithmetic
operation.
Employee Details
Algorithm:
Step: 1: Start the program
Step: 2: Read the basic details of the employee
Step: 3: Read the basic pay of the employee
Step: 4: By using (or) basic pay calculate the HRA,DA,PF, and IT
Step: 5: Display the employee details and also salary details like HRA,DA,PF, and IT
Step: 6: Stop the program
Inference: From the above program, we came to know about the concept of “Employee
details”
Electricity Bills
Algorithm:
Step: 1: Start the program
Step: 2: Read the customer details
Step: 3: Read the previous and current reading
Step: 4: Calculate the units by subtracting the previous reading from current reading.
Step: 5: If the unit is less than 100 than charge is same as that of the unit consumed
Step: 6: If the unit is less than 200 than subtract 100 from the unit and sorted in unit
stream
Step: 7: Multiply the unit stream by 2nd and store in charge and add 100 to the charge
Step: 8: Display the customer details with the electricity bill
Step: 9: Stop the programe
Step:10: If the processes delete the specified element as deleted from the queue
Step: 11 Save the programe
Inference: From the above program, we came to know about the concept of Electricity
bill using Unix.
File Manupulation
Algorithm:
Step: 1: Start the programe
Step: 2: Open the vi editor with the new file name
Step: 3: Create a function addition to insert the contents
Step: 4: Create a function edit to edit a file
Step: 5: Create a function sort to get the contents of the file sorted
Inference: From the above program, we came to know about the concept of File
manipulation in Unix
Finding Biggest Number
Algorithm:
Step: 1: Start the program
Step: 2: Enter the number which is to be final as the biggest one, among the declared
numbers.
Step: 3: Read the numbers a,b,c
Step: 4: compare the numbers a & b, if `a` is greater than b than compare a and c
Step: 5: Display a is the biggest number
Inference: From the above program, we came to know about the concept of Finding
biggest number in Unix.
Fibonacci Series
Algorithm:
Step: 1: Start the program
Step: 2: Road the no. of the series, n
Step: 3: The Fibonacci series is calculated using the expression $a+$b; a=-1; b:1
Step: 4: The above step is repeated again and again until `n` value becomes zero
Step: 5: Display the Fibonacci series
Inference: From the above program, we came to know about the concept of Fibonacci
series in Unix.