coding in C- Create a function called reverseList that takes the head.docxtienlivick
coding in C;
Create a function called reverseList that takes the head of a linked list, reverses the order of all the nodes. For example, if the list contained 1, 2, 3, 4 in its nodes, the list will now contain 4, 3, 2, 1.
please add a main test.
Solution
Please find the required program below:
#include<stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node* next;
};
void push(struct node** head, int new_element)
{
struct node* new_node =
(struct node*) malloc(sizeof(struct node));
new_node->data = new_element;
new_node->next = (*head);
(*head) = new_node;
}
void printList(struct node *head)
{
struct node *temp = head;
while(temp != NULL)
{
printf(\"%d \", temp->data);
temp = temp->next;
}
}
void reverseList(struct node** head)
{
struct node* prev = NULL;
struct node* current = *head;
struct node* next;
while (current != NULL)
{
next = current->next;
current->next = prev;
prev = current;
current = next;
}
*head = prev;
}
int main()
{
struct node* head = NULL;
push(&head, 12);
push(&head, 14);
push(&head, 5);
push(&head, 8);
printf(\"\ Linked list Before Reversing :\ \");
printList(head);
reverseList(&head);
printf(\"\ Linked list After Reversing :\ \");
printList(head);
}
--------------------------------------------------------------------------------
OUTPUT:
Linked list Before Reversing :
8Â Â 5Â Â 14Â Â 12
Linked list After Reversing :
12Â Â 14Â Â 5Â Â 8
.
This presentations gives an introduction to the data structure linked-lists. I discuss the implementation of header-based linked-lists in C. The presentation runs through the code and provides the visualization of the code w.r.t pointers.
coding in C- Create a function called reverseList that takes the head.docxtienlivick
coding in C;
Create a function called reverseList that takes the head of a linked list, reverses the order of all the nodes. For example, if the list contained 1, 2, 3, 4 in its nodes, the list will now contain 4, 3, 2, 1.
please add a main test.
Solution
Please find the required program below:
#include<stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node* next;
};
void push(struct node** head, int new_element)
{
struct node* new_node =
(struct node*) malloc(sizeof(struct node));
new_node->data = new_element;
new_node->next = (*head);
(*head) = new_node;
}
void printList(struct node *head)
{
struct node *temp = head;
while(temp != NULL)
{
printf(\"%d \", temp->data);
temp = temp->next;
}
}
void reverseList(struct node** head)
{
struct node* prev = NULL;
struct node* current = *head;
struct node* next;
while (current != NULL)
{
next = current->next;
current->next = prev;
prev = current;
current = next;
}
*head = prev;
}
int main()
{
struct node* head = NULL;
push(&head, 12);
push(&head, 14);
push(&head, 5);
push(&head, 8);
printf(\"\ Linked list Before Reversing :\ \");
printList(head);
reverseList(&head);
printf(\"\ Linked list After Reversing :\ \");
printList(head);
}
--------------------------------------------------------------------------------
OUTPUT:
Linked list Before Reversing :
8Â Â 5Â Â 14Â Â 12
Linked list After Reversing :
12Â Â 14Â Â 5Â Â 8
.
This presentations gives an introduction to the data structure linked-lists. I discuss the implementation of header-based linked-lists in C. The presentation runs through the code and provides the visualization of the code w.r.t pointers.
pleaase I want manual solution forData Structures and Algorithm An.pdfwasemanivytreenrco51
pleaase I want manual solution for
Data Structures and Algorithm Analysis in C++, Third Edition
By Clifford A. Shaffer
because my question from this book.page270 ,question 7.4
The implementation for Mergesort given in Section 7.4 takes an array as input and sorts that
array. At the beginning of Section 7.4 there is a simple pseudocode implementation for sorting a
linked list using Mergesort. Implement both a linked list-based version of Mergesort and the
array-based version of Mergesort, and compare and analyze their running times.
Solution
Linked list:
#include
#include
struct node
{
int data;
struct node* next;
};
struct node* SortedMerge(struct node* a, struct node* b);
void FrontBackSplit(struct node* source,
struct node** frontRef, struct node** backRef);
void MergeSort(struct node** headRef)
{
struct node* head = *headRef;
struct node* a;
struct node* b;
if ((head == NULL) || (head->next == NULL))
{
return;
}
FrontBackSplit(head, &a, &b);
MergeSort(&a);
MergeSort(&b);
*headRef = SortedMerge(a, b);
}
struct node* SortedMerge(struct node* a, struct node* b)
{
struct node* result = NULL;
if (a == NULL)
return(b);
else if (b==NULL)
return(a);
if (a->data <= b->data)
{
result = a;
result->next = SortedMerge(a->next, b);
}
else
{
result = b;
result->next = SortedMerge(a, b->next);
}
return(result);
}
void FrontBackSplit(struct node* source,
struct node** frontRef, struct node** backRef)
{
struct node* fast;
struct node* slow;
if (source==NULL || source->next==NULL)
{
*frontRef = source;
*backRef = NULL;
}
else
{
slow = source;
fast = source->next;
while (fast != NULL)
{
fast = fast->next;
if (fast != NULL)
{
slow = slow->next;
fast = fast->next;
}
}
*frontRef = source;
*backRef = slow->next;
slow->next = NULL;
}
}
void printList(struct node *node)
{
while(node!=NULL)
{
printf(\"%d \", node->data);
node = node->next;
}
}
void push(struct node** head_ref, int new_data)
{
struct node* new_node =
(struct node*) malloc(sizeof(struct node));
new_node->data = new_data;
new_node->next = (*head_ref);
(*head_ref) = new_node;
}
int main()
{
struct node* res = NULL;
struct node* a = NULL;
push(&a, 15);
push(&a, 10);
push(&a, 5);
push(&a, 20);
push(&a, 3);
push(&a, 2);
MergeSort(&a);
printf(\"\ Sorted Linked List is: \ \");
printList(a);
getchar();
return 0;
}
Time complexity:o(nlogn)
Array :
#include
#include
void merge(int arr[], int l, int m, int r)
{
int i, j, k;
int n1 = m - l + 1;
int n2 = r - m;
int L[n1], R[n2];
for (i = 0; i < n1; i++)
L[i] = arr[l + i];
for (j = 0; j < n2; j++)
R[j] = arr[m + 1+ j];
i = 0; // Initial index of first subarray
j = 0;
k = l;
while (i < n1 && j < n2)
{
if (L[i] <= R[j])
{
arr[k] = L[i];
i++;
}
else
{
arr[k] = R[j];
j++;
}
k++;
}
while (i < n1)
{
arr[k] = L[i];
i++;
k++;
}
while (j < n2)
{
arr[k] = R[j];
j++;
k++;
}
}
void mergeSort(int arr[], int l, int r)
{
if (l < r)
{
int m = l+(r-l)/2;
// Sort first and second halves
mergeSort(arr, l, m);
mergeSort(arr, m+1, r);
merge(arr, l, m, r);
}
}
void printArray(int A[], i.
Explore the world of C programming assignments with expert guidance and practical tips. Dive into a range of C assignment solutions designed for varying complexity levels. Get insights from industry experts passionate about sharing their C programming knowledge. Discover time-saving techniques to boost productivity and meet assignment deadlines. Access 24/7 customer support and budget-friendly pricing options.
Ready to excel in C programming assignments? Head over to https://www.programminghomeworkhelp.com/c-assignment/ to embark on a journey toward academic excellence. Don't let C assignments hold you back. Join us on the path to success today!
Need help getting past an error in C++! I have all my code pasted down.docxJason0x0Scottw
Need help getting past an error in C++!
I have all my code pasted down below. My issue is that I'm trying to call the functions I have in main, but they don't do anything as they are now. I'm almost positive I need to call them with parenthesis, but putting them in always results with an error saying "A nonstatic member reference must be relative to a specific object."
Below will be the source file, then the header file I made all the functions in. Thanks in advance, y'all are the best!
(Source.ccp)
#include "Header.h"
int main() {
NoteList noteList;
noteList.loadData("input.txt");
bool finish = false;
int choice;
while (finish != true) {
cout << "\n** Menu **\n"
<< "1. LIST NOTES BY DATE\n"
<< "2. LIST NOTES BY COMPOSER\n"
<< "3. DELETE MOST RECENT NOTE\n"
<< "4. EXIT\n" << endl;
cin >> choice;
if (choice == 1)
{
&NoteList::listNotesByDate();
}
else if (choice == 2)
{
&NoteList::listNotesByComposer;
}
else if (choice == 3)
{
&NoteList::deleteFrontNote;
}
else if (choice == 4)
{
cout << "\nOperations ended";
finish = true;
}
else
{
cout << "\nInput not recognized. Please choose a number between 1 and 4." << endl;
}
}
return 0;
}
(Header.h)
#pragma once
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
class Date {
private:
int month, day, year;
public:
Date() : month(0), day(0), year(0) {}
void setDate(string strDate) {
month = stoi(strDate.substr(0, 2));
day = stoi(strDate.substr(3, 2));
year = stoi(strDate.substr(6, 4));
}
string showDate() {
return to_string(month) + "-" + to_string(day) + "-" + to_string(year);
}
int calculateDays() {
return year * 365 + month * 31 + day;
}
};
class Note {
private:
string composer;
Date date;
string subject;
string body;
public:
Note(string c, string d, string s, string b) : composer(c), subject(s), body(b) {
date.setDate(d);
}
string getComposer() {
return composer;
}
Date getDate() {
return date;
}
string getSubject() {
return subject;
}
string getBody() {
return body;
}
};
struct noteNode {
Note note;
noteNode* next;
};
class NoteList {
private:
noteNode* head;
public:
NoteList() : head(nullptr) {}
void loadData(const char* filename) {
ifstream file(filename);
if (file.is_open()) {
string line;
string composer, date, subject, body;
while (getline(file, line)) {
if (line == "##########") {
Note note = Note(composer, date, subject, body);
addNote(note);
composer.clear();
date.clear();
subject.clear();
body.clear();
}
else if (line.substr(0, 10) == "COMPOSER: ") {
composer = line.substr(10);
}
else if (line.substr(0, 6) == "DATE: ") {
date = line.substr(6);
}
else if (line.substr(0, 9) == "SUBJECT: ") {
subject = line.substr(9);
}
else {
body += line + "\n";
}
}
file.close();
}
else {
cerr << "Unable to open file " << filename << endl;
}
}
void addNote(Note note) {
noteNode* newNode = new noteNode{note, head};
newNode->note = note;
newNode->next = head;
head =.
Download the ppt for animation of Singly linked list insertion and deletion
Note: if you have downloaded it in .pdf, convert it to .pptx and press F5 for animation.
Help explain the code with line comments public class CompletedLis.pdfalmonardfans
Help explain the code with line comments
public class CompletedList implements ListADT, Iterable
{
//Three instance variables
protected int count;
protected int modChange;
protected DoubleLinearNode head, tail;
//head and tail set to empty count set to zero
public CompletedList() {
head = tail = null;
count = 0;
}
//Override for head and tail, remove first number of list
@Override
public T removeFirst() throws NoSuchElementException
{
//if head is empty return error
if(isEmpty())
throw new NoSuchElementException("The collection is empty");
//Temp for each number set to head item
T temp = head.getItem();
//if first number equals last they are null
if(head == tail)
{
head = tail = null;
}
//else the ne
else if(head.getNext() == tail)
{
head.remove();
head = tail;
}
else
{
head = head.getNext();
head.getPrev().remove();
}
count--;
modChange++;
return temp;
}
@Override
public T removeLast() throws NoSuchElementException
{
if(isEmpty())
throw new NoSuchElementException("The collection is empty");
T temp = tail.getItem();
if(head == tail)
{
head = tail = null;
}
else if(head.getNext() == tail){
tail.remove();
tail = head;
}
else
{
tail = tail.getPrev();
tail.getNext().remove();
}
count--;
modChange++;
return temp;
}
@Override
public T remove( T element )
{
if(isEmpty())
throw new NoSuchElementException("The target is not in the collection");
if(tail.getItem().equals(element))
{
return removeLast();
}
for (DoubleLinearNode current = head; current != null; current = current.getNext())
{
if(current.getItem().equals(element))
{
if(current == head)
{
return removeFirst();
}
else
{
count--;
modChange++;
return current.remove();
}
}
}
throw new NoSuchElementException("The target is not in the collection");
}
@Override
public T first()
{
if (isEmpty())
throw new NoSuchElementException("The collection is empty");
return head.getItem();
}
@Override
public T last()
{
if (isEmpty())
throw new NoSuchElementException("The collection is empty");
return tail.getItem();
}
@Override
public boolean contains( T target )
{
if(isEmpty())
return false;
if(tail.getItem().equals(target))
{
return true;
}
for (DoubleLinearNode current = head; current != null; current = current.getNext())
{
if(current.getItem().equals(target))
{
return true;
}
}
return false;
}
@Override
public boolean isEmpty()
{
return count == 0;
}
@Override
public int size()
{
return count;
}
@Override
public Iterator iterator()
{
return new ListIterator(head);
}
@Override
public String toString()
{
StringBuilder sb = new StringBuilder();
for (DoubleLinearNode current = head; current != null; current = current.getNext())
{
sb.append(current.getItem()).append(' ');
}
return sb.toString();
}
private class ListIterator implements Iterator
{
private DoubleLinearNode current;
private int modNum;
public ListIterator( DoubleLinearNode node)
{
this.modNum = modChange;
this.current = node;
}
@Override
public boolean hasNext()
{
if(this.modNum != modChange)
throw new ConcurrentModificationException("The collection.
C code on linked list #include stdio.h #include stdlib.h.pdfdeepua8
For the ethanol water graph the simple distillation should be a steady smooth
increase, the fractional distillation should look like an s, that sort of takes a straight up jump in
the middle. I am unsure about the other mixture though sorry, hope that helps
Solution
For the ethanol water graph the simple distillation should be a steady smooth
increase, the fractional distillation should look like an s, that sort of takes a straight up jump in
the middle. I am unsure about the other mixture though sorry, hope that helps.
pleaase I want manual solution forData Structures and Algorithm An.pdfwasemanivytreenrco51
pleaase I want manual solution for
Data Structures and Algorithm Analysis in C++, Third Edition
By Clifford A. Shaffer
because my question from this book.page270 ,question 7.4
The implementation for Mergesort given in Section 7.4 takes an array as input and sorts that
array. At the beginning of Section 7.4 there is a simple pseudocode implementation for sorting a
linked list using Mergesort. Implement both a linked list-based version of Mergesort and the
array-based version of Mergesort, and compare and analyze their running times.
Solution
Linked list:
#include
#include
struct node
{
int data;
struct node* next;
};
struct node* SortedMerge(struct node* a, struct node* b);
void FrontBackSplit(struct node* source,
struct node** frontRef, struct node** backRef);
void MergeSort(struct node** headRef)
{
struct node* head = *headRef;
struct node* a;
struct node* b;
if ((head == NULL) || (head->next == NULL))
{
return;
}
FrontBackSplit(head, &a, &b);
MergeSort(&a);
MergeSort(&b);
*headRef = SortedMerge(a, b);
}
struct node* SortedMerge(struct node* a, struct node* b)
{
struct node* result = NULL;
if (a == NULL)
return(b);
else if (b==NULL)
return(a);
if (a->data <= b->data)
{
result = a;
result->next = SortedMerge(a->next, b);
}
else
{
result = b;
result->next = SortedMerge(a, b->next);
}
return(result);
}
void FrontBackSplit(struct node* source,
struct node** frontRef, struct node** backRef)
{
struct node* fast;
struct node* slow;
if (source==NULL || source->next==NULL)
{
*frontRef = source;
*backRef = NULL;
}
else
{
slow = source;
fast = source->next;
while (fast != NULL)
{
fast = fast->next;
if (fast != NULL)
{
slow = slow->next;
fast = fast->next;
}
}
*frontRef = source;
*backRef = slow->next;
slow->next = NULL;
}
}
void printList(struct node *node)
{
while(node!=NULL)
{
printf(\"%d \", node->data);
node = node->next;
}
}
void push(struct node** head_ref, int new_data)
{
struct node* new_node =
(struct node*) malloc(sizeof(struct node));
new_node->data = new_data;
new_node->next = (*head_ref);
(*head_ref) = new_node;
}
int main()
{
struct node* res = NULL;
struct node* a = NULL;
push(&a, 15);
push(&a, 10);
push(&a, 5);
push(&a, 20);
push(&a, 3);
push(&a, 2);
MergeSort(&a);
printf(\"\ Sorted Linked List is: \ \");
printList(a);
getchar();
return 0;
}
Time complexity:o(nlogn)
Array :
#include
#include
void merge(int arr[], int l, int m, int r)
{
int i, j, k;
int n1 = m - l + 1;
int n2 = r - m;
int L[n1], R[n2];
for (i = 0; i < n1; i++)
L[i] = arr[l + i];
for (j = 0; j < n2; j++)
R[j] = arr[m + 1+ j];
i = 0; // Initial index of first subarray
j = 0;
k = l;
while (i < n1 && j < n2)
{
if (L[i] <= R[j])
{
arr[k] = L[i];
i++;
}
else
{
arr[k] = R[j];
j++;
}
k++;
}
while (i < n1)
{
arr[k] = L[i];
i++;
k++;
}
while (j < n2)
{
arr[k] = R[j];
j++;
k++;
}
}
void mergeSort(int arr[], int l, int r)
{
if (l < r)
{
int m = l+(r-l)/2;
// Sort first and second halves
mergeSort(arr, l, m);
mergeSort(arr, m+1, r);
merge(arr, l, m, r);
}
}
void printArray(int A[], i.
Explore the world of C programming assignments with expert guidance and practical tips. Dive into a range of C assignment solutions designed for varying complexity levels. Get insights from industry experts passionate about sharing their C programming knowledge. Discover time-saving techniques to boost productivity and meet assignment deadlines. Access 24/7 customer support and budget-friendly pricing options.
Ready to excel in C programming assignments? Head over to https://www.programminghomeworkhelp.com/c-assignment/ to embark on a journey toward academic excellence. Don't let C assignments hold you back. Join us on the path to success today!
Need help getting past an error in C++! I have all my code pasted down.docxJason0x0Scottw
Need help getting past an error in C++!
I have all my code pasted down below. My issue is that I'm trying to call the functions I have in main, but they don't do anything as they are now. I'm almost positive I need to call them with parenthesis, but putting them in always results with an error saying "A nonstatic member reference must be relative to a specific object."
Below will be the source file, then the header file I made all the functions in. Thanks in advance, y'all are the best!
(Source.ccp)
#include "Header.h"
int main() {
NoteList noteList;
noteList.loadData("input.txt");
bool finish = false;
int choice;
while (finish != true) {
cout << "\n** Menu **\n"
<< "1. LIST NOTES BY DATE\n"
<< "2. LIST NOTES BY COMPOSER\n"
<< "3. DELETE MOST RECENT NOTE\n"
<< "4. EXIT\n" << endl;
cin >> choice;
if (choice == 1)
{
&NoteList::listNotesByDate();
}
else if (choice == 2)
{
&NoteList::listNotesByComposer;
}
else if (choice == 3)
{
&NoteList::deleteFrontNote;
}
else if (choice == 4)
{
cout << "\nOperations ended";
finish = true;
}
else
{
cout << "\nInput not recognized. Please choose a number between 1 and 4." << endl;
}
}
return 0;
}
(Header.h)
#pragma once
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
class Date {
private:
int month, day, year;
public:
Date() : month(0), day(0), year(0) {}
void setDate(string strDate) {
month = stoi(strDate.substr(0, 2));
day = stoi(strDate.substr(3, 2));
year = stoi(strDate.substr(6, 4));
}
string showDate() {
return to_string(month) + "-" + to_string(day) + "-" + to_string(year);
}
int calculateDays() {
return year * 365 + month * 31 + day;
}
};
class Note {
private:
string composer;
Date date;
string subject;
string body;
public:
Note(string c, string d, string s, string b) : composer(c), subject(s), body(b) {
date.setDate(d);
}
string getComposer() {
return composer;
}
Date getDate() {
return date;
}
string getSubject() {
return subject;
}
string getBody() {
return body;
}
};
struct noteNode {
Note note;
noteNode* next;
};
class NoteList {
private:
noteNode* head;
public:
NoteList() : head(nullptr) {}
void loadData(const char* filename) {
ifstream file(filename);
if (file.is_open()) {
string line;
string composer, date, subject, body;
while (getline(file, line)) {
if (line == "##########") {
Note note = Note(composer, date, subject, body);
addNote(note);
composer.clear();
date.clear();
subject.clear();
body.clear();
}
else if (line.substr(0, 10) == "COMPOSER: ") {
composer = line.substr(10);
}
else if (line.substr(0, 6) == "DATE: ") {
date = line.substr(6);
}
else if (line.substr(0, 9) == "SUBJECT: ") {
subject = line.substr(9);
}
else {
body += line + "\n";
}
}
file.close();
}
else {
cerr << "Unable to open file " << filename << endl;
}
}
void addNote(Note note) {
noteNode* newNode = new noteNode{note, head};
newNode->note = note;
newNode->next = head;
head =.
Download the ppt for animation of Singly linked list insertion and deletion
Note: if you have downloaded it in .pdf, convert it to .pptx and press F5 for animation.
Help explain the code with line comments public class CompletedLis.pdfalmonardfans
Help explain the code with line comments
public class CompletedList implements ListADT, Iterable
{
//Three instance variables
protected int count;
protected int modChange;
protected DoubleLinearNode head, tail;
//head and tail set to empty count set to zero
public CompletedList() {
head = tail = null;
count = 0;
}
//Override for head and tail, remove first number of list
@Override
public T removeFirst() throws NoSuchElementException
{
//if head is empty return error
if(isEmpty())
throw new NoSuchElementException("The collection is empty");
//Temp for each number set to head item
T temp = head.getItem();
//if first number equals last they are null
if(head == tail)
{
head = tail = null;
}
//else the ne
else if(head.getNext() == tail)
{
head.remove();
head = tail;
}
else
{
head = head.getNext();
head.getPrev().remove();
}
count--;
modChange++;
return temp;
}
@Override
public T removeLast() throws NoSuchElementException
{
if(isEmpty())
throw new NoSuchElementException("The collection is empty");
T temp = tail.getItem();
if(head == tail)
{
head = tail = null;
}
else if(head.getNext() == tail){
tail.remove();
tail = head;
}
else
{
tail = tail.getPrev();
tail.getNext().remove();
}
count--;
modChange++;
return temp;
}
@Override
public T remove( T element )
{
if(isEmpty())
throw new NoSuchElementException("The target is not in the collection");
if(tail.getItem().equals(element))
{
return removeLast();
}
for (DoubleLinearNode current = head; current != null; current = current.getNext())
{
if(current.getItem().equals(element))
{
if(current == head)
{
return removeFirst();
}
else
{
count--;
modChange++;
return current.remove();
}
}
}
throw new NoSuchElementException("The target is not in the collection");
}
@Override
public T first()
{
if (isEmpty())
throw new NoSuchElementException("The collection is empty");
return head.getItem();
}
@Override
public T last()
{
if (isEmpty())
throw new NoSuchElementException("The collection is empty");
return tail.getItem();
}
@Override
public boolean contains( T target )
{
if(isEmpty())
return false;
if(tail.getItem().equals(target))
{
return true;
}
for (DoubleLinearNode current = head; current != null; current = current.getNext())
{
if(current.getItem().equals(target))
{
return true;
}
}
return false;
}
@Override
public boolean isEmpty()
{
return count == 0;
}
@Override
public int size()
{
return count;
}
@Override
public Iterator iterator()
{
return new ListIterator(head);
}
@Override
public String toString()
{
StringBuilder sb = new StringBuilder();
for (DoubleLinearNode current = head; current != null; current = current.getNext())
{
sb.append(current.getItem()).append(' ');
}
return sb.toString();
}
private class ListIterator implements Iterator
{
private DoubleLinearNode current;
private int modNum;
public ListIterator( DoubleLinearNode node)
{
this.modNum = modChange;
this.current = node;
}
@Override
public boolean hasNext()
{
if(this.modNum != modChange)
throw new ConcurrentModificationException("The collection.
C code on linked list #include stdio.h #include stdlib.h.pdfdeepua8
For the ethanol water graph the simple distillation should be a steady smooth
increase, the fractional distillation should look like an s, that sort of takes a straight up jump in
the middle. I am unsure about the other mixture though sorry, hope that helps
Solution
For the ethanol water graph the simple distillation should be a steady smooth
increase, the fractional distillation should look like an s, that sort of takes a straight up jump in
the middle. I am unsure about the other mixture though sorry, hope that helps.
Opendatabay - Open Data Marketplace.pptxOpendatabay
Opendatabay.com unlocks the power of data for everyone. Open Data Marketplace fosters a collaborative hub for data enthusiasts to explore, share, and contribute to a vast collection of datasets.
First ever open hub for data enthusiasts to collaborate and innovate. A platform to explore, share, and contribute to a vast collection of datasets. Through robust quality control and innovative technologies like blockchain verification, opendatabay ensures the authenticity and reliability of datasets, empowering users to make data-driven decisions with confidence. Leverage cutting-edge AI technologies to enhance the data exploration, analysis, and discovery experience.
From intelligent search and recommendations to automated data productisation and quotation, Opendatabay AI-driven features streamline the data workflow. Finding the data you need shouldn't be a complex. Opendatabay simplifies the data acquisition process with an intuitive interface and robust search tools. Effortlessly explore, discover, and access the data you need, allowing you to focus on extracting valuable insights. Opendatabay breaks new ground with a dedicated, AI-generated, synthetic datasets.
Leverage these privacy-preserving datasets for training and testing AI models without compromising sensitive information. Opendatabay prioritizes transparency by providing detailed metadata, provenance information, and usage guidelines for each dataset, ensuring users have a comprehensive understanding of the data they're working with. By leveraging a powerful combination of distributed ledger technology and rigorous third-party audits Opendatabay ensures the authenticity and reliability of every dataset. Security is at the core of Opendatabay. Marketplace implements stringent security measures, including encryption, access controls, and regular vulnerability assessments, to safeguard your data and protect your privacy.
Techniques to optimize the pagerank algorithm usually fall in two categories. One is to try reducing the work per iteration, and the other is to try reducing the number of iterations. These goals are often at odds with one another. Skipping computation on vertices which have already converged has the potential to save iteration time. Skipping in-identical vertices, with the same in-links, helps reduce duplicate computations and thus could help reduce iteration time. Road networks often have chains which can be short-circuited before pagerank computation to improve performance. Final ranks of chain nodes can be easily calculated. This could reduce both the iteration time, and the number of iterations. If a graph has no dangling nodes, pagerank of each strongly connected component can be computed in topological order. This could help reduce the iteration time, no. of iterations, and also enable multi-iteration concurrency in pagerank computation. The combination of all of the above methods is the STICD algorithm. [sticd] For dynamic graphs, unchanged components whose ranks are unaffected can be skipped altogether.
As Europe's leading economic powerhouse and the fourth-largest hashtag#economy globally, Germany stands at the forefront of innovation and industrial might. Renowned for its precision engineering and high-tech sectors, Germany's economic structure is heavily supported by a robust service industry, accounting for approximately 68% of its GDP. This economic clout and strategic geopolitical stance position Germany as a focal point in the global cyber threat landscape.
In the face of escalating global tensions, particularly those emanating from geopolitical disputes with nations like hashtag#Russia and hashtag#China, hashtag#Germany has witnessed a significant uptick in targeted cyber operations. Our analysis indicates a marked increase in hashtag#cyberattack sophistication aimed at critical infrastructure and key industrial sectors. These attacks range from ransomware campaigns to hashtag#AdvancedPersistentThreats (hashtag#APTs), threatening national security and business integrity.
🔑 Key findings include:
🔍 Increased frequency and complexity of cyber threats.
🔍 Escalation of state-sponsored and criminally motivated cyber operations.
🔍 Active dark web exchanges of malicious tools and tactics.
Our comprehensive report delves into these challenges, using a blend of open-source and proprietary data collection techniques. By monitoring activity on critical networks and analyzing attack patterns, our team provides a detailed overview of the threats facing German entities.
This report aims to equip stakeholders across public and private sectors with the knowledge to enhance their defensive strategies, reduce exposure to cyber risks, and reinforce Germany's resilience against cyber threats.
Explore our comprehensive data analysis project presentation on predicting product ad campaign performance. Learn how data-driven insights can optimize your marketing strategies and enhance campaign effectiveness. Perfect for professionals and students looking to understand the power of data analysis in advertising. for more details visit: https://bostoninstituteofanalytics.org/data-science-and-artificial-intelligence/
1. 717822E504
QUESTIONS 2.2:
a) Write a C program to implement the following operations on a Singly Linked List.
(1) InsertionAtBegin() (2) InsertionAtEnd() (3) InsertionAtPosition() (4) DeletionAtBegin()
(5) DeletionAtEnd() (6) DeletionAtPosition() (7) Display
b) Write a C program to implement the following operations on a Circular Singly Linked List.
(1) InsertionAtBegin() (2) InsertionAtEnd() (3) InsertionAtPosition() (4) DeletionAtBegin()
(5) DeletionAtEnd() (6) DeletionAtPosition() (7) Display
c) Write a C program to print the sum of the nodes of a Singly Linked List.
Task is to do: 5 + 10 + 20 + 1
Output: 36
2. 717822E504
Ex. No: 2.2(a)
Singly Linked List
Date:
AIM:
To write a C program to implement the following operations on a Singly Linked List.
(1) InsertionAtBegin() (2) InsertionAtEnd() (3) InsertionAtPosition() (4) DeletionAtBegin()
(5) DeletionAtEnd() (6) DeletionAtPosition() (7) Display
PSEUDO CODE:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None
def add(self, data):
new_node = Node(data)
if self.head is None:
self.head = new_node
else:
current = self.head
while current.next is not None:
current = current.next
current.next = new_node
def delete(self, key):
if self.head is None:
return
if self.head.data == key:
self.head = self.head.next
return
current = self.head
prev = None
while current is not None and current.data != key:
prev = current
current = current.next
if current is None:
return
prev.next = current.next
def display(self):
current = self.head
if self.head is None:
print("List is empty")
else:
6. 717822E504
}
void Display() {
struct node *temp=head;
while(temp != NULL) {
printf("%d ",temp->data);
temp=temp->next;
}
}
int main() {
InsertionAtBegin(10);
InsertionAtBegin(20);
InsertionAtEnd(30);
InsertionAtPosition(40, 3);
DeletionAtBegin();
DeletionAtEnd();
DeletionAtPosition(2);
Display();
return 0;
}
OUTPUT:
RESULT:
Thus the program to implement the following operations on a Singly Linked List is compiled and
executed successfully.
7. 717822E504
Ex. No: 2.2(b)
Circular Singly Linked List
Date:
AIM:
To write a C program to implement the following operations on a Circular Singly Linked List.
(1) InsertionAtBegin() (2) InsertionAtEnd() (3) InsertionAtPosition() (4) DeletionAtBegin()
(5) DeletionAtEnd() (6) DeletionAtPosition() (7) Display
PSEUDO CODE:
def __init__(self, data):
self.data = data
self.next = None
class CircularLinkedList:
def __init__(self):
self.head = None
def add(self, data):
new_node = Node(data)
if self.head is None:
self.head = new_node
new_node.next = self.head
else:
current = self.head
while current.next != self.head:
current = current.next
current.next = new_node
new_node.next = self.head
def delete(self, key):
if self.head is None:
return
if self.head.data == key and self.head.next == self.head:
self.head = None
return
elif self.head.data == key:
current = self.head
while current.next != self.head:
current = current.next
current.next = self.head.next
self.head = self.head.next
else:
current = self.head
prev = None
while current.next != self.head:
prev = current
current = current.next
8. 717822E504
if current.data == key:
prev.next = current.next
return
def display(self):
current = self.head
if self.head is None:
print("List is empty")
else:
while True:
print(current.data)
current = current.next
if current == self.head:
break
SOURCE CODE:
#include <stdio.h>
#include <stdlib.h>
struct node {
int data;
struct node *next;
};
struct node *head = NULL;
void insertionAtBegin(int value) {
struct node *newNode = (struct node *)malloc(sizeof(struct node));
newNode->data = value;
if (head == NULL) {
head = newNode;
newNode->next = head;
} else {
struct node *temp = head;
while (temp->next != head) {
temp = temp->next;
}
temp->next = newNode;
newNode->next = head;
head = newNode;
}
13. 717822E504
Ex. No: 2.2(c)
Sum of nodes in Singly Linked List
Date:
AIM:
To write a C program to print the sum of the nodes of a Singly Linked List.
PSEUDO CODE:
sum = 0
current = head
while current is not None:
sum += current.data
current = current.next
print(sum)
SOURCE CODE:
#include <stdio.h>
#include <stdlib.h>
struct node {
int data;
struct node *next;
};
void insert(struct node **head, int data) {
struct node *new_node = (struct node *)malloc(sizeof(struct node));
new_node->data = data;
new_node->next = (*head);
(*head) = new_node;
}
int sum_of_nodes(struct node *head) {
int sum = 0;
struct node *temp = head;
while (temp != NULL) {
sum += temp->data;
temp = temp->next;
}
return sum;
}
void print_list(struct node *node) {
14. 717822E504
while (node != NULL) {
printf("%d ", node->data);
node = node->next;
}
}
int main() {
struct node *head = NULL;
insert(&head, 1);
insert(&head, 10);
insert(&head, 20);
insert(&head, 5);
printf("Linked List: ");
print_list(head);
printf("nSum of nodes: %d", sum_of_nodes(head));
return 0;
}
OUTPUT:
RESULT:
Thus the program to print the sum of the nodes in the Singly Linked List is compiled and executed
successfully.
PREPARATION 30
LAB PERFORMANCE 30
REPORT 40
TOTAL 100
INITIAL OF FACULTY