Found 83 Articles for Miscellaneous

Difference Between malloc and calloc

AmitDiwan
Updated on 24-Mar-2021 12:31:57

694 Views

In this post, we will understand the difference between malloc and calloc.MallocThe method ‘malloc’ is used to assign a block of memory when it is requested.It doesn’t clear the memory.It only initializes the allocated memory when explicitly requested.It allocates memory of a specific ‘size’.This size is passed as parameter to it.This size is allocated from a heap.It performs its job quickly.Examplevoid *malloc(size_t size);CallocIt assigns the requested memory to multiple blocks.This memory allocated is initiated to zero.This initialization to 0 is done by ‘calloc’ method.It allocates memory to the required operation of a specific ‘size’, i.e num * size.The ‘num’ refers ... Read More

Difference Between Stack and Queue

AmitDiwan
Updated on 24-Mar-2021 12:28:30

677 Views

In this post, we will understand the difference between Stack and Queue.StackThey are based on LIFO- Last In First Out.This means the element inserted at the end is the first element to get deleted.Insertion and deletion happen in a stack from one end only, i.e the top.Insert operation is known as ‘push’ operation.Delete operation is known as ‘pop’ operation.A pointer is used to access the list, it is known as ‘top’.The ‘top’ points to the last element of the list.It helps work with problems associated with recursion.Representation of Stack (LIFO)QueuesThey are based on FIFO- First In First Out.This means the ... Read More

Difference Between Linear Search and Binary Search

AmitDiwan
Updated on 24-Mar-2021 12:26:13

2K+ Views

In this post, we will understand the difference between Linear Search and Binary Search.Linear SearchIt searches through the array/list from the beginning to the end.Every element in the array/list is compared to the element that needs to be searched.It goes till the end of the list.If the element is found, a message is returned, with the index.If the element is not found, relevant message is returned.The elements don't need to be arranged in a specific/sorted order.It can be implemented on any linear data structure like an array, linked list.It is based on sequential approach.It is preferable to use it with ... Read More

Difference Between Applet and Application

AmitDiwan
Updated on 23-Mar-2021 08:42:12

2K+ Views

In this post, we will understand the difference between Applet and Application.ApplicationThey are similar to Java programs.They can be executed independently without using web browser.It requires a ’main’ function for it to be executed.Java applications have full access to local file system and network.They can access all kinds of resources that are available to the system.They can execute the programs with the help of the local system.An application program is required when a task needs to be directly performed for the user.AppletsThey are small Java programs.They have been designed to be included with HTML documents.They need Java enabled web browser ... Read More

Difference Between Link and Association

AmitDiwan
Updated on 23-Mar-2021 08:01:46

6K+ Views

In this post, we will understand the difference between Link and Association.LinkIt can be understood as the physical connection between objects.It helps tell about the relationship among objects.It is represented using line segment between objects.They can’t be referenced.It is used in UML designs.AssociationIt is a specification about the collection of links.The connections are related to classes.It is a general relationship between classes.They are implemented using programming languages as a reference model.It shows connections between classes using line segments.It is used in UML designs.

Difference Between Friend Function and Friend Class

AmitDiwan
Updated on 23-Mar-2021 08:01:22

4K+ Views

In this post, we will understand the difference between Friend function and Friend class.Friend FunctionIt is usually used with operator overloading operation.It is used with the ‘friend’ keyword.It helps give a non-member function the access to the private members of the class.It has to be declared before it is used.It is used to access private and protected members of the class.It can be a global function or a function in another class.Exampleclass Node {    private:    int val;    Node* next;    // Other members of Node Class //    friend int LinkedList::search();    // Only search method ... Read More

Difference Between Server-side Scripting and Clientside Scripting

AmitDiwan
Updated on 23-Mar-2021 07:38:59

5K+ Views

In this post, we will understand the difference between server-side scripting and client-side scripting.Server-side ScriptingIt helps work with the back end.It doesn’t depend on the client.It runs on the web server.It helps provide a response to every request that comes in from the user/client.This is not visible to the client side of the application.It requires the interaction with the server for the data to be process.Server side scripting requires languages such as PHP, ASP.net, ColdFusion, Python, Ruby on Rails.It is considered to be a secure way of working with applications.It can be used to customize web pages.It can also be ... Read More

Difference Between CGI and Servlet

AmitDiwan
Updated on 23-Mar-2021 08:09:28

2K+ Views

In this post, we will understand the difference between CGI and servlet.ServletIt is a Java class that helps extend the abilities of servers.These are the servers that help host applications, which are accessed using a requestresponse model.They help extend the applications that are hosted using web servers.But they also have the ability to respond to other kinds of requests.For different kinds of applications, HTTP-specific servlet classes can be defined using Java Servlet.These programs are written in Java, and they run on Java virtual machine.It is based on thread.This means that for every new request, a new thread is created.It is ... Read More

Difference Between Linear Queue and Circular Queue

AmitDiwan
Updated on 23-Mar-2021 07:14:18

2K+ Views

In this post, we will understand the difference between linear queue and circular queue −Linear QueueIt is a linear data structure, which data is arranged in a linear pattern.Operations such as insertion and deletion are done from rear and front respectively.It requires more memory, since data is stored in a linear fashion.The element that is added to a linear queue at first, is the element that gets deleted first.It follows FIFO, i.e first in first out.The element that is inserted first is the element that is deleted first as well.It is not as efficient as a circular queue structure.Circular QueueThe ... Read More

Difference Between Insertion Sort and Selection Sort

AmitDiwan
Updated on 23-Mar-2021 07:13:57

2K+ Views

Insertion SortIn Insertion Sort, the values are inserted in a list/array wherein some of the values are previous sorted.It is a stable sorting algorithm.The best case time complexity is O(N) (when the list has been sorted in ascending order).A key value is defined, and the array is iterated from the beginning to the end.The current element during iteration is compared to the key value.The number of comparison operations made during insertion sort is less than the number of the element swapping that is done.If the key element is smaller than the element with which it is being compared, the previous ... Read More

Advertisements