Write a program in c++ of doubly linked list and implement create a new node, insertion in list, search element in list, delete from list, reverse, traversal.
Write a program in C++ that reads in a set of positive integers, representing test scores for a class, and outputs how many times a particular number appears in the list. You may assume that the data set has, at most, 100 numbers and that -999 marks the end of the input data. The numbers must be output in increasing order. For example, for the following data, the output is: 55 80 78 92 95 55 78 53 92 65 78 95 85 92 85 95 95
Write a program that creates three identical arrays, list1, list2, and list3 of 5000 elements. The program then sorts list1 using bubble sort, list2 using selection sort, and list3 using insertion sort and outputs the number of comparisons and item assignments made by each sorting algorithm.
Edit and complete this linked list code to ASK and DISPLAY, how many members, 1st, middle, lastname, area code, tel number, gender, age
import java.io.*;
public class FinalNode {
public int data;
public FinalNode next;
public static FinalNode firstNode;
public static FinalNode lastNode=null;
public FinalNode(int d,FinalNode n)
{
data=d;
next=n;
}
public static void main(String[] args) throws IOException{
int numnodes, num;
BufferedReader s= new BufferedReader(new InputStreamReader(System.in));
System.out.print("How many nodes to input? ");
numnodes = Integer.parseInt(s.readLine());
for(int i=0;i<numnodes;i++){
System.out.print("Enter node"+(i+1)+":");
num = Integer.parseInt(s.readLine());
FinalNode n =new FinalNode(num, null);
if(lastNode!=null)
{
lastNode.next=n;
lastNode=n;
}
else
{
firstNode=n;
lastNode=n;
}
}
System.out.print("entered nodes: ");
FinalNode n=firstNode;
while(n!=null)
{
System.out.print(n.data+"\t");
n=n.next;
}
System.out.println();
}
}
Sort the following list using the selection sort algorithm. Show the list after each iteration of the outer for loop. 36, 55, 17, 35, 63, 85, 12, 48, 3, 66
Consider the following list: 2 10 17 45 49 55 68 85 92 98 110 Using the binary search, how many comparisons are required to determine whether the following items are in the list or not? Show the values of first, last, and middle and the number of comparisons after each iteration of the loop.
Sort the following list using the bubble sort algorithm. Show the list after each iteration of the outer
for loop.
26, 45, 17, 65, 33, 55, 12, 18
elif op==16 :
print ("Functions Menu")
print ("j. asinh")
print ("k. acosh")
print ("l. atanh")
fun = raw_input("Choose the function :")
a = float(input("Enter the value :"))
dict6 = {'j':math.asinh(a), 'k':math.acosh(a), 'l':math.atanh(a)}
print ("The result is : " + str(dict6.get(fun)) )
else :
print ("Wrong Choice")
Question:
1. In this program, you will create a class and OOP.
elif op==14 :
print ("Functions Menu")
print ("d. asin")
print ("e. acos")
print ("f. atan")
fun = input("Choose the function :")
a = float(nput("Enter the value :"))
dict4 = {'d':math.asin(a), 'e':math.acos(a), 'f':math.atan(a)}
print ("The result is : " + str(dict4.get(fun)))
elif op==15 :
print ("Functions Menu")
print ("g. sinh")
print ("h. cosh")
print ("i. tanh")
fun = input("Choose the function :")
a = float(input("Enter the angle in radians :"))
dict5 = {'g':math.sinh(a), 'h':math.cosh(a),'i':math.tanh(a)}
print ("The result is : " + str(dict5.get(fun)) )
Question:
1. In this program, you will create a class and OOP.
Write the array implementation of a list.
Requirements:
1)create class
2)No global declarations
3) functions
Isempty()
Delete()
Insert()
Display()
4)Call the functions in main