Skip to content

Instantly share code, notes, and snippets.

View Liyansu's full-sized avatar
🏠
Working from home

Liyansu

🏠
Working from home
View GitHub Profile
@Liyansu
Liyansu / 8.8 Que.txt
Created June 5, 2021 18:41
8.8 Implement a treeset to retrieve and remove the highest and lowest value
Implement a treeset to retrieve and remove the highest and lowest value
@Liyansu
Liyansu / 8.7 Que.txt
Created June 5, 2021 18:40
8.7 Create a treeset with names of five vegetables of type string
[ ] Create a treeset with names of five vegetables of type string.
[ ] Traverse the elements of treeset in descending order
@Liyansu
Liyansu / QueuemainClass.java
Last active June 11, 2021 16:31
8.6 Make a program to implement linked list as deque.
import java.util.*;
class DequemainClass
{
static class Node
{
int data;
Node prev, next;
static Node getnode(int data)
{
Node newNode = new Node();
@Liyansu
Liyansu / 8.5 Que.txt
Created June 5, 2021 18:36
8.5 Make a program to implement linked list as queue
Queue Front : 40
Queue Rear : 50
@Liyansu
Liyansu / 8.4 Que.txt
Created June 5, 2021 18:35
8.4 Create a linked list named animals
[ ] Create a linked list named animals
[ ] Add 5 animals namely cow, buffalo, goat, camel and donkey of type String
[ ] Then remove buffalo from the linked list.
[ ] Then remove the animal at index 3.
[ ] After that remove the first animal and the last animal.
[ ] Print the updated linked list
@Liyansu
Liyansu / numbersClass.java
Created June 5, 2021 18:33
8.3 Create an Array List with name numbers.
[ ] Size of Numbers ArrayList = 5
[ ] Add 5 numbers of type Integer
[ ] calculate the size of ArrayList
@Liyansu
Liyansu / 8.2 Que.txt
Created June 5, 2021 18:31
8.2 Create an ArrayList with name fruits
[ ] Create an ArrayList with name fruits
[ ] Add 5 fruits of type String namely mango, banana, chickoo, grapes and orange
[ ] Instead of chickoo add pineapple to the arraylist
[ ] print the updated list
@Liyansu
Liyansu / 8.1 Que.txt
Created June 5, 2021 18:23
8.1 Create an ArrayList with name CSLanguages
[ ] Create an ArrayList with name CSLanguages
[ ] Add 5 computer science languages of type String
[ ] Iterate through the languages using for-each loop
[ ] print those languages
@Liyansu
Liyansu / 7.5 Que.txt
Last active June 5, 2021 18:14
7.5 Implement TreeSet. Enter 10 nodes with values from 1 to 10.
Implement TreeSet.
Enter 10 nodes with values from 1 to 10.
Remove node with value 5 and print the Treeset.
Check whether the node has been removed or not.
Now remove all the elements from the Treeset and again print the Treeset
@Liyansu
Liyansu / 7.4 Que.txt
Created June 5, 2021 18:01
7.4 Implement TreeSet. Enter nodes. Print Initial set, reverse set, headset, subset and tailset
[ ] Implement $TreeSet$.
[ ] Enter nodes.
[ ] Print Initial set, reverse set, headset, subset and $tailset$.