Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A linked list is a linear collection of self-referential structures, called node

ID: 3779539 • Letter: A

Question

A linked list is a linear collection of self-referential structures, called nodes, connected by pointer links-hence, the term "linked" list. [T/F] A string is a series of characters treated as a single unit. It may include letters, digits and various special characters such as +, -, ", /, and $. [T/F] The value returned by the function fclose is EOF if the file is successfully closed. [T/F] The function streat() receives two strings as arguments and attaches string2 onto the front of string1. [T/F] Linked list nodes are normally stored contiguously in memory. [T/F] For each of the following choose the correct answer: A linear collection of data elements given by mean of pointer is called. a. Linked list b. Queue c. Stack d. Graph Linked list is generally considered as an example of type of memory allocation. a. Static b. Dynamic c. Compile time d. None of these. What is the purpose of "a" in fopen() function used below in the code. FILE *fp; fp = fopen("source.txt", "a"); a. open "source.txt" for reading b. open -source.txt" for appending at the end of the file c. Create a new file "source.txt" for writing d. None of above If the two strings are identical, then strcmp() function returns a. -1 b. 1 c. 0 d. yes

Explanation / Answer

Here goes the answers for the given questions!

Part 1:

1.True

A Linked list is a linear collection of nodes which are self referencial structures. Each node will store data and will have another pointer or two which points to other nodes. Since they are linearly connected with one another, it is called as "Linked List"

2. True

A character is a single element.it might be a letter, number, symbol.etc. A series of such characters is called as a string and it can be a combination of one or more letters, numbers, symbols.

3. False

If a stream is successfully closed then a zero value is returned and
on failure EOF is returned

4. False

strcat() is a string function and is used to concat two separate strings. It accepts two arguments.
eg. strcat(str1,str2)
and str2 is added to the end of str1

5. False

Nodes in a linked link are not neccessarily to be contiguous and occupy adjacent blocks of memory. Generally the 'next' pointer in the node will point to the address of the next node

Part 2:

1. a.Linked List
Linked list is a collection of data elements connected with a pointer.

2. b.Dynamic
Linked list decides the memory allocation at run time, hence it is a Dynamic type of memory.

3. b.open source.txt for appending at the end of the file
a stands for append. It appends at the end of file. If there is no file then it creates a new file.

4. c.0
strcmp(s1, s2);
Returns 0 if s1 and s2 are the same; less than 0 if s1<s2; greater than 0 if s1>s2.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote