DSA

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Primitive data structures

A data structure that cannot be decomposed to other data structures. Integers, float, pointers, Booleans, and characters are under this type. These primitive data structures are the basis for the discussion of a more sophisticated data structure.

&

Address

Dequeue

Check if the queue is empty. If empty, display an underflow error and exit. Else, the access element is pointed out by 'front'. Increment the 'front' to point to the next accessible data. Return success.

Enqueue

Check if the queue is full. If full, produce overflow error and exit. Else, increment 'rear'. Add an element to the location pointed by 'rear'. Return success.

isempty()

Checks if the queue is empty.

isfull()

Checks if the queue is full.

Non-linear data structure

Data items are not arranged in sequential order.

Linear data structure

Elements are connected and accessed in sequential order by means of logically or in sequence memory locations.

trees, graphs

Examples of Non-linear data structure

peek()

Gets the element at the front of the queue without removing it This function helps to see the data at the front of the queue..

Traffic system

In computer-controlled traffic system, circular queues are used to switch on the traffic lights one by one repeatedly as per the time set.

Null

It indicates that there is no next node.

Binary Search

It involves separating a list in half and search that half, then split that half again and search on it and carry on to split and search until a match is found in that arranged list.

list

It is a collection of an ordered sequence of items.

linked list

It is a data structure that uses pointers to connect individual list elements and it is also made up of multiple nodes that contain the address of the next node.

Interpolation search

It is a development over Binary Search for instances, where the values in an arranged array are uniformly distributed. Binary Search always goes to the middle part to check.

Non-primitive data structures

It is a more complicated data structure and is derived from one or more primitive data structures. The simple data structures built from primitives are strings, arrays, lists, records, and files.

destructor

It is a special member function of a class that is executed whenever an object of its class goes out of scope or whenever the delete expression is applied to a pointer to the object of that class.

constructor

It is a special member function of a class that is executed whenever we create new objects of that class.

circular queue

It is a type of queue in which the last position is connected to the first position, which is represented by the shape of a circle.

Time Complexity

It is a way to signify the amount of time needed by the program to run to completion.

queue

It is an abstract data type or linear data structure, somewhat similar to stacks.

rear or tail

It is considered as an ordered collection of items where the insertion of new element happens at one end

Linear search

It is performed where the array starts, walking along the array seeking for the match.

Space Complexity

It is the amount of memory space necessary by the algorithm, during the course of its execution. Space complexity must be taken extremely for multi-user systems and in situations where limited memory is available.

IsEmpty

It is used to check if the stack is empty

IsFull

It is used to check if the stack is full

Peek or Top

It is used to look at elements in the stack without removing them

Pop

It is used to remove an element from the stack

Class

It is used to specify the form of an object and it combines data representation and methods for manipulating that data into one neat package.

Pointers

It is used to store addresses of a variable.

queue

It is usually of people or things waiting for something. It implements the idea of "first come, first serve", in which the first person or thing coming from that line will be prioritized first before turning to the next, then afterwards they can get out from the line.

Abstract Data Type

It is which is independent of implementation.

First-in, Last-out

Meaning of FILO

Last-In, First-Out

Meaning of LIFO

CPU Scheduling

Operating systems often maintain a queue of processes that are ready to execute or that are waiting for a particular event to occur.

Head

The figure represents the linked list with a pointer to the first node of the list

Memory Management

The unused memory locations in the case of ordinary queues can be utilized in circular queues.

Priority Queues

each element was based on the urgency of the need.

stacks, queues, and linked list

examples of linear data structure

Algorithm

is a finite set of instructions or procedures, written in order, to solve a certain predefined task.

Data Structure

it is a way of collecting and organizing elements or items of data. It is an arrangement of data in a computer's memory in such a way that it can access quickly to the processor for the required calculations.

Data member/s

known as the variables inside the class and the member function/s are known as the method that performs specific tasks in the class.

private

makes data and functions private

public

makes data and functions public

Data

represents the overall resource of the organization, it can exist in different forms; such as numbers and characters/text on pieces of paper, as bits and bytes stored in computer memory, or as raw facts stored in a person's mind.

Environment Space

space necessary to store the environment information needed to restart the suspended function.

Data Space

space required to store all the constants and variables value.

Instruction Space

space required to store the executable version of the program. This space is static but differs depending upon the number of lines of code in the program

front or head

the removal of existing element takes place from the other end called

Push()

used to add an element to the stack

*

used to declare pointer variable


संबंधित स्टडी सेट्स

The Revolution in Energy and Industry

View Set

Exam 1- learning objectives (2700)

View Set

What Is Psychology? - Quiz (100%)

View Set

Human Biology: Digestive and Excretory Systems

View Set

Meiosis 2 & Differences Between mitosis and meiosis Flashcard Set

View Set