linked-list

Linked Excel Object in Powerpoint wont update when showing in slideshow

岁酱吖の 提交于 2020-01-24 00:17:18
问题 I'm new to this and basically what I want to do is: -I have 2 excel files and 1 powerpoint presentation -all of the files are in a shared network -I linked my excel files to the powerpoint -I have office 2003 and 2007 versions The problem: I play the slideshow of the powerpoint and set it to loop on 1 computer to display it on a big LCD at work, I then access the excel files on a separate computer and update it from there, the problem is the slideshow that is playing wont display my changes

Print a singly-linked list backwards, in constant space and linear time

强颜欢笑 提交于 2020-01-22 14:07:15
问题 I heard an interview question: "Print a singly-linked list backwards, in constant space and linear time." My solution was to reverse the linkedlist in place and then print it like that. Is there another solution that is nondestructive? 回答1: If you reverse it again after printing it will no longer be destructive, since the original order is restored. 回答2: You've already figured out most of the answer: reverse the linked list in place, and traverse the list back to the beginning to print it. To

Print a singly-linked list backwards, in constant space and linear time

北战南征 提交于 2020-01-22 14:07:08
问题 I heard an interview question: "Print a singly-linked list backwards, in constant space and linear time." My solution was to reverse the linkedlist in place and then print it like that. Is there another solution that is nondestructive? 回答1: If you reverse it again after printing it will no longer be destructive, since the original order is restored. 回答2: You've already figured out most of the answer: reverse the linked list in place, and traverse the list back to the beginning to print it. To

Why are Stack<T> and Queue<T> implemented with an array?

喜欢而已 提交于 2020-01-19 00:42:06
问题 I'm reading C# 4.0 in a Nutshell by the Albahari brothers and I came across this: Stacks are implemented internally with an array that's resized as required , as with Queue and List. (pg 288, paragraph 4) I can't help but wonder why. LinkedList provides O(1) head and tail inserts and deletes (which should work well for a stack or queue). A resizable array has O(1) amortized insert (if I remember right), but O(n) worst case (I'm not sure about delete). And it probably uses more space than the

Reverse linked list recursively

最后都变了- 提交于 2020-01-17 13:48:24
问题 I am trying to do a reverse linked list recursively using pointer to pointer but the problem is that in the second loop the script crash. Can you help me in order to solve my problem. This is my code : void reverseNumber(Mynbr** start){ Mynbr *header; Mynbr *current; if ((*start)){ header = (*start); current = (*start)->next; if (current && current->next!= NULL) { reverseNumber(current->next); header = current; current->next->next = current; current->next = NULL; } } } 回答1: The way should be

Merge two array using ratio wise in java

梦想的初衷 提交于 2020-01-17 09:06:10
问题 I have two array like this. String[] arr1 = {"11","22","33","44","55","66","77"}; String[] arr2 = {"111","222","333","444","555","666","777","888","999"}; I want to merge these two array using combination of index value. My input will be two integer value (2:3 ratio), like this int firstArray = 2; //input value int secondArray = 3; //input value After merge all value will be stored in single list. Now i need output like this. 11 22 111 222 333 33 44 444 555 666 55 66 777 888 999 77 Input

Valgrind Error when creating an array of linked lists (for Hash Table Chaining)

回眸只為那壹抹淺笑 提交于 2020-01-17 06:17:08
问题 As an overview, I'm trying to create a battleship-like game in C, where ships are placed on a field. Here is the error I am getting: ==11147== Invalid write of size 8 ==11147== at 0x400786: MakeField (battleship.c:34) ==11147== Address 0x8 is not stack'd, malloc'd or (recently) free'd Here is the relevant code: struct piece{ int x; int y; int direction; int length; char name; }; struct node{ struct piece boat; struct node *next; }; struct field{ int numBoats; struct node *array[numRows]; };

I always run into a infinite loop on running this program.

流过昼夜 提交于 2020-01-17 05:39:04
问题 This code is for the insertion of a node in a linked list after a value/data of "2" is found in the list. #include<iostream> using namespace std; struct list{ int data; list *next; }; list * create(){ char a; int i=1; list *move,*start,*temp; start=new list(); temp=start; cout<<"Do u want to enter a new node. Press y but anything.\n"; cin>>a; while(a=='y'){ cout<<"Enter data for node "<<i<<endl; cin>>start->data; move=new list(); start->next=move; start=start->next; i++; cout<<"Do u want to

Inserting New Node

£可爱£侵袭症+ 提交于 2020-01-17 05:21:22
问题 Here is a function of a program I'm writing to get more familiar with nodes. It creates a new node and inserts the information into the code field and then points to the existing first node. Then assigns the head to the newly created node; Unfortunately it's giving me a incompatible types for new_node->location = code; typedef char LibraryCode[4]; typedef struct node { LibraryCode location; struct node *next; } Node; void insertFirstNode(LibraryCode code, Node **listPtr) { Node *new_node; new

Linked list deletion and duplication

﹥>﹥吖頭↗ 提交于 2020-01-17 04:40:27
问题 In the code I copied newnode to the head node and also to the temp node. But when I delete an instance of data, it seems to affect the other locations as well. When I freed newnode it also erases the content of head and temp .How is this happening? Though I copied data initially, the data is freed. This is due to dereferencing? So what should I do if I want to have a copy list and want to manipulate this without affecting the original? And I initially malloc'd the memory I want by malloc()