Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Lab Assignments Sheet 4 (UTA-009)

1 Write a program to read data from an input.txt file and write alternative characters into
two output files- first.txt and second.txt.
2 A text file has text data into. Take a character from the user at run time and check whether
that character is stored in the text file. Also count the existence of that character.
3 Write a program to create two threads. One thread print the simple interest and second
thread prints the compound interest. Assume that principal amount, rate of interest and
time are the instance variables of the thread class. Show that execution in the main
method.
4 Write a program to implement linear and binary search. Take data at the run time.
5 Write a methods to sort array of integers using
(i) Bubble
(ii) Selection
(iii) Insertion
6 Write the push and pop methods of an integer stack. Display the even integers only when
pop operation is performed.
7 Write insertion, deletion and traverse operations for a queue. Each node of the queue has
integer number as its data.
8 Write insertion, deletion and traverse operations for a singly linked list. Each node of
the queue has roll no, name and class as its data. Extend this program for double linked
list.
9 Write a program to implement Tower of Hanoi problem using the concept of recursion.

You might also like