Posts

Showing posts with the label Study Material

Array

Image
  An array is a collection of similar data elements stored at contiguous memory locations. It is the simplest data structure where each data element can be accessed directly by only using its index number. For instance, if we want to store the marks scored by a student in 5 subjects, then there’s no need to define individual variables for each subject. Rather, we can define an array which will store the data elements at contiguous memory locations. · array  marks[5]  defines the marks scored by a student in 5 different subjects where each subject marks are located at a particular location in the array i.e.  marks[0]  denotes the marks scored in first subject,  marks[1]  denotes the marks scored in 2nd subject and so on.
  STACKS in Data Structure A stack is  an abstract data type that holds an ordered, linear sequence of items . In contrast to a queue, a stack is a last in, first out (LIFO) structure. A real-life example is a stack of plates: you can only take a plate from the top of the stack, and you can only add a plate to the top of the stack... Click here to Know more

Asymptotic notations

  Data Structure The main idea of asymptotic analysis is to have a measure of efficiency of algorithms that doesn’t depend on machine specific constants,  and doesn’t require algorithms to be implemented and time taken by programs to be compared. Asymptotic notations are mathematical tools to represent time complexity of algorithms for asymptotic analysis.  The following 3 asymptotic notations are mostly used to represent time complexity of algorithms. 1) Θ Notation, 2) Big O Notation, 3) Ω Notation. Click here to learn more

Applet

Java is an Object Oriented Programming language, supported by various classes. The Applet class is packed in the Java. Applet package which has several interfaces. These interfaces enable the creation of Applets, interaction of Applets with the browser, and playing audio clips in Applets. In Java 2, class Javax.swing.  JApplet is used to define an Applet that uses the Swing GUI components.  Applet is a special type of program that is embedded in the webpage to generate the dynamic content. It runs inside the browser and works at client side.  Applet is embedded in a HTML page using the APPLET or OBJECT tag and hosted on a web server. Applets are used to make the web site more dynamic and entertaining. Below is the list given for Do’s and Don’ts of Java Applets:  Do’s  • Draw pictures on a web page   • Create a new window and draw the picture in it.   •Play sounds.   • Receive input from the user through the keyboard ...

Difference between NP-hard and NP-complete problems

Let us take two problems A and B both are NP problems. Reducibility - If we can convert one instance of a problem A into problem B (NP problem) then it means that A is reducible to B. NP-hard - Now suppose we found that A is reducible to B, then it means that B is at least as hard as A. NP-Complete - The group of problems which are both in NP and NP-hard are known as NP-Complete problem. P  is set of problems that can be solved by a deterministic Turing machine in  P olynomial time. NP  is set of decision problems that can be solved by a  N on-deterministic Turing Machine in  P olynomial time. P is subset of NP

Turing Machine

Turing Machine was invented by Alan Turing in 1936 and it is used to accept Recursive Enumerable Languages (generated by Type-0 Grammar). Turing Machine (Halt State Version)   A Turing Machine is a sextuple of the form  7-tuple (Q, T, B, ∑, δ, q0, B, F) where: Q  is a finite set of states T  is the tape alphabet (symbols which can be written on Tape) B  is blank symbol (every cell is filled with B except input alphabet initially) ∑  is the input alphabet (symbols which are part of input alphabet) δ  is a transition function which maps Q × T → Q × T × {L,R}. Depending on its present state and present tape alphabet (pointed by head pointer), it will move to new state, change the tape symbol (may or may not) and move head pointer to either left or right. q 0  is the initial state F  is the set of final states. If any state of F is reached, input string is accepted  A  Turing machine  is a...

Stacks Data Structure

Stacks & Algorithm Stack is a linear data structure which follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out). Mainly the following three basic operations are performed in the stack: Push:  Adds an item in the stack. If the stack is full, then it is said to be an Overflow condition. Pop:   Removes an item from the stack. The items are popped in the reversed order in which they are pushed. If the stack is empty, then it is said to be an Underflow condition. Peek or Top:   Returns top element of stack. isEmpty:  Returns true if stack is empty, else false. Click below to download!!  👇

Discreate Mathmatics Book PDF

Click below to download.....