Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Allocation: .Are Linked Lists Considered Linear or Non-Linear Data Structures?

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

 .Are linked lists considered linear or non-linear data structures?

It depends on where you intend to apply linked lists. If you based it on storage, a linked list is considered
non-linear. On the other hand, if you based it on access strategies, then a linked list is considered linear.

 Differentiate between calloc() and malloc()(dynamic memory


allocation
Ans: calloc() and malloc() are memory dynamic memory allocating functions. The only difference between
them is that calloc() will load all the assigned memory locations with value 0 but malloc() will not.

 Differentiate between Actual Parameters and Formal Parameters.


 Ans: The Parameters which are sent from main function to the subdivided function are called as Actual
Parameters and the parameters which are declared a the Subdivided function end are called as Formal
Parameters.

 Differentiate between getch() and getche().


Ans: Both the functions are designed to read characters from the keyboard and the only difference is that

getch(): reads characters from the keyboard but it does not use any buffers. Hence, data is not displayed on
the screen.

getche(): reads characters from the keyboard and it uses a buffer. Hence, data is displayed on the screen.

 Mention File operations in C Language.


fopen() To Open a File
fclose() To Close a File
fgets() To Read a File
fprint() To Write into a File
 What is typecasting?
Ans: Typecasting is a process of converting one data type into another is known as typecasting. 

 Write a C program to print hello world without using a semicolon


(;).
Ans: 

1 #include<stdio.h>     
2 void main()
3 {     
4       if(printf("hello world")){}
}
5
 What is Bubble Sort Algorithm? Explain with a program.
Ans: Bubble sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent
elements and swaps them if they are in the wrong order. The pass through the list is repeated until the list is
sorted. 

List the area of applications where stack data structure can be used?

o Expression evaluation
o Backtracking
o Memory Management
o Function calling and return

What are the operations that can be performed on a stack?

o Push Operations
o Pop Operations

 stack overflow condition.

Overflow occurs when top = Maxsize -1

postfix form of the expression: (A + B) * (C - D)

AB+CD-*

Are linked lists considered linear or non-linear data structures?

Both

List some applications of queue data structure.

The Applications of the queue is given as follows:

o Queues are widely used as waiting lists for a single shared resource like a printer, disk, CPU.
o Queues are used in the asynchronous transfer of data (where data is not being transferred at the same
rate between two processes) for eg. pipes, file IO, sockets.
o Queues are used as buffers in most of the applications like MP3 media player, CD player, etc.
o Queues are used to maintain the playlist in media players to add and remove the songs from the play-
list.
o Queues are used in operating systems for handling interrupts.

Which data structure suits the most in the tree construction?


Queue data structure

What is the difference between JDK, JRE, and JVM?

JVM

JVM is an acronym for Java Virtual Machine; it is an abstract machine which provides the runtime environment
in which Java bytecode can be executed. It is a specification which specifies the working of Java Virtual Machine.
Its implementation has been provided by Oracle and other companies. Its implementation is known as JRE.

JVMs are available for many hardware and software platforms (so JVM is platform dependent). It is a runtime
instance which is created when we run the Java class. There are three notions of the JVM: specification,
implementation, and instance.

JRE

JRE stands for Java Runtime Environment. It is the implementation of JVM. The Java Runtime Environment is a
set of software tools which are used for developing Java applications. It is used to provide the runtime
environment. It is the implementation of JVM. It physically exists. It contains a set of libraries + other files that
JVM uses at runtime.

JDK

JDK is an acronym for Java Development Kit. It is a software development environment which is used to
develop Java applications and applets. It physically exists. It contains JRE + development tools. JDK is an
implementation of any one of the below given Java Platforms released by Oracle Corporation:

Is delete, next, main, exit or null keyword in java?

No.

Is constructor inherited?

No, The constructor is not inherited.

What is this keyword in java?

The this keyword is a reference variable that refers to the current object. There are the various uses of this
keyword in Java. 

What is the constructor?

The constructor can be defined as the special type of method that is used to initialize the state of an object. It is
invoked when the class is instantiated, and the memory is allocated for the object. 

What are the main features of OOPs?


What is Polymorphism?

Polymorphism is composed of two words - “poly” which means “many”, and “morph”
which means “shapes”. Therefore Polymorphism refers to something that has many
shapes.

A function is a group of statements that together perform a task. ... A function declaration tells the
compiler about a function's name, return type, and parameters. A function definition provides the actual
body of the function. The C standard library provides numerous built-in functions that your program can
call.

C function aspects Syntax

1 Function declaration return_type function_name (argument list);

2 Function call function_name (argument_list)

3 Function definition return_type function_name (argument list) {function body;}

You might also like