[Solved] I don’t understand this hash-function code

The purpose of a hash function ist to retrieve a unique value for a given sequence (of bytes, characters, …). Therefore you need the length of the sequence, here with ‘strlen’. Without bit shift operator (<<) you would get the same result for the sequence ‘abc’ and ‘cba’. The xor operator (^) ‘scrambles”https://stackoverflow.com/”hashes’ the current … Read more

[Solved] Range of linked lists [closed]

Your linked list declaration is wrong. You don’t use [] when creating a new object in java. Instead you use (). And your generic type is also wrong -> if you want to have more linked lists inside the main linked list. Try this LinkedList<LinkedList> LK = new LinkedList<>(); Note – The part inside <> … Read more

[Solved] Assorting linked list in c [duplicate]

Simplest will be bubble sort. item* sort(item *start){ item *node1,*node2; int temp; for(node1 = start; node1!=NULL;node1=node1->next){ for(node2 = start; node2!=NULL;node2=node2->next){ if(node2->draw_number > node1->draw_number){ temp = node1->draw_number; node1->draw_number = node2->draw_number; node2->draw_number = temp; } } } return start; } 1 solved Assorting linked list in c [duplicate]

[Solved] What goes in to the parentheses of studentList.addStudent()? [closed]

Q: What (if any) argument gets passed in to studentList.addStudent()? A: That depends entirely on what parameters the addStudent() method of “studentList’s` class takes. In your case: studentList is a Manager (poor name for either variable or class, but..) Manager.addStudent() takes an object of class type Student. You need to have an object of type … Read more

[Solved] Pointer variable of a linked list: difference between the variable, reference to the variable, and pointer to the variable [closed]

No! You’re talking some mix-up of C and C++. This is C code. C does not have references. The & operator can be applied to objects in order to retrieve their address in memory, yielding a pointer, in both C and C++. It ain’t got nothing to do with references. Even in C++. In C++, … Read more

[Solved] ACCEPT ELEMENTS IN A LINKED LIST IN ASCENDING ORDER,but the display function prints the smallest number instead of the whole linked list

ACCEPT ELEMENTS IN A LINKED LIST IN ASCENDING ORDER,but the display function prints the smallest number instead of the whole linked list solved ACCEPT ELEMENTS IN A LINKED LIST IN ASCENDING ORDER,but the display function prints the smallest number instead of the whole linked list

[Solved] my output of link list is not correct? [closed]

Remember pressing Enter after entering data for the previous scanf? This newline character is consumed by the scanf with a %c. You have to change scanf(“%c”,&ch); fflush(stdin); to scanf(” %c”, &ch); so that the scanf will skip the newline character left over by the previous scanf. The space before %c is a whitespace character and … Read more

[Solved] Do-while acting funny in my basic singly linked list implementation in C. Please identify the error [closed]

When you enter anything for input with Scanf, you end it with a newline. The problem is that the scanf function only extracts the input requested, and leaves the newline in the input buffer, so in the next iteration the program reads and extracts that newline and sees it as invalid input and loops once … Read more