Difference between linked list and array?
Answers were Sorted based on User's Feedback
Answer / shyamu sharma
Linked List is dynamic, Array is static.
Searching : Fast in Linked List, Slow in Array.
Array is fixed length, Linked List Unlimited till Memory end.
Is This Answer Correct ? | 12 Yes | 1 No |
Memory address of items in the array are continues but they
are not continues in the linked list. So you will easily to
access one item in an array, but not for a linked list.
However, you can easily insert or remove one item into/from
a linked list.
Is This Answer Correct ? | 8 Yes | 1 No |
Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. Your program should work for squares of all side sizes between 1 and 20. --- │ │ │ │ │ │ ---
What is a c++ object?
What is a dangling pointer?
What is a singleton class c++?
How do you define a class in c++?
Write a program which employs Recursion
What is operator overloading in c++ example?
Read the following program carefully and write the output of the program. Explain each line of code according to given numbering. #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <errno.h> 1……………… int main (void) { pid_t pid; 2………………………… pid = fork(); 3…………………………. if (pid > 0) { int i; 4………………………… for (i = 0; i < 5; i++) { 5………………… …………… printf(" I AM VU : %d\n", i); 6………………… …………… sleep(1); } exit(0); } 7………………… ……… else if (pid == 0) { int j; for (j = 0; j < 5; j++) { 8……………………………… printf(" I have no child: %d\n", j); sleep(1); } _exit(0); } else { 9………………………………fprintf(stderr, "can't fork, error %d\n", errno); 10……………… … ………… exit (EXIT_FAILURE); } }
Explain abstraction.
Should the this pointer can be used in the constructor?
Will this c++ program execute or not?
Explain working of printf?