Given an integer N as a string number and K as input, write a program to print a number pyramid K rows
create a program that determines the type of medal of the total score.The users enters 3 scores from 3 sorts. 10 points is the highest scorein a sport
Given an input undirected graph, write a program to find all articulation points in tgraph. An
articulation point is a vertex whose removal disconnects graph. (Assume that input graph is
connected.) If a graph has no articulation points, it is called a biconnected graph.
Input Format: input text file which describes an undirected graph. first line of file
specifies n & m, number of vertices and number of edges in the graph respectively.next m
lines specify the m edges of graph, one line per edge. An edge is described by its end points. If
number of vertices is n, assume vertices of graph are numbered (0,1,..n-1).
Output Format: Print “Biconnected Graph” if input graph has no articulation points. If
articulation points are found, print vertices articulation points.
Sample Input 1 (for graph shown on the right):
7 8
0 1
0 2
2 1
2 3
4 2
3 5
4 6
5 6
Sample Output 1
Articulation points found:
2
Sample Input 2 (for the graph shown on the right):
4 4
0 1
1 2
2 3
3 0
Sample Output 2
Biconnected Graph
Problem 1: Given an input undirected graph, write a program to check if the graph is two-edge connected or not. If the graph is not two-edge connected, print all the bridge edges. (Assume that the input graph is connected.) Input Format: The input is a text file which describes an undirected graph. The first line of the file specifies n & m, the number of vertices and number of edges in the graph respectively. The next m lines specify the m edges of the graph, one line per edge. An edge is described by its end points. If the number of vertices is n, assume that the vertices of the graph are numbered (0,1,..n-1). Output Format: Print YES, if the input graph is two-edge connected, NO otherwise. If printing NO, print all the bridge edges in the graph. Sample Input 1 (for the graph shown on the right): 8 10 0 1 1 2 0 3 3 4 3 6 4 6 5 4 5 6 7 6 5 7 Sample Output 1: NO 1 2 0 1 0 3 Sample Input 2 (for the graph shown on the right): 8 12 0 1 0 2 0 6 1 3 1 7 2 3 2 4 3 5 4 5 4 6 5 7 6 7 Sample Output 2: YES
Create a min-heap . write function to insert a new number in min-heap . write function to delete its minimum element . write function to delete a given element from min-heap . write function to sort it in descending order .
single digit numbers
Write a loop that inputs words until the user enters STOP. After each input, the program should number each entry and print in this format:
Find latitude and longitude of utmost 20 countries, ordered by population, with a population greater or equal to the population limit given below and have atleast one currency exclusively for themselves. (countries like Madagascar, Sri Lanka but not India, USA). Use the country details from this dataset.
Your task is to find the sum of the length of all lines (in kms) that can be drawn between co-ordinates of these countries.
Assume radius of earth: 6371 km
Round length of each line and final result to 2 decimal points
If co-ordinates are missing for any country use 0.000 N 0.000 E
Population limit: 20792
Note: Population limit will change at random intervals. So please make sure answer is computed for the correct population limit before submitting.
Find latitude and longitude of utmost 20 countries, ordered by population, with a population greater or equal to the population limit given below and have atleast one currency exclusively for themselves. (countries like Madagascar, Sri Lanka but not India, USA). Use the country details from this dataset.
Your task is to find the sum of the length of all lines (in kms) that can be drawn between co-ordinates of these countries.
Assume radius of earth: 6371 km
Round length of each line and final result to 2 decimal points
If co-ordinates are missing for any country use 0.000 N 0.000 E
Population limit: 20792
Note: Population limit will change at random intervals. So please make sure answer is computed for the correct population limit before submitting.
in a building, there are N rooms numbered from 1 to N. In each room there is a bulb that is initially ON for the odd-numbered rooms and OFF for the even-numbered rooms.before visiting a room, you will note the state of the bulb. when you leave a room, the bulb is turned OFF if it is ON and turned ON if it is OFF. you visit all rooms in the same order as they are numbered. you then return to the starting room and repeat the process for N times. you are given N, write a program that should output the state of the bulb in each room for every visit
Note: Print 1 if the bulb is ON, 0 otherwise
I/p: The input is a single line containing a positive integer N representing the number of room in the building
O/p: The output contains N lines each line containing the state of the bulb in the room numbered from 1 to N
Note: These is a space after each 1 or 0
I/p: N=5
1 0 1 0 1
0 1 0 1 0
1 0 1 0 1
0 1 0 1 0
1 0 1 0 1
I/p: N=6
O/p:
1 0 1 0 1 0
0 1 0 1 0 1
1 0 1 0 1 0
0 1 0 1 0 1
1 0 1 0 1 0
0 1 0 1 0 1