I am having trouble understanding the following concepts when it comes to progra
ID: 3640317 • Letter: I
Question
I am having trouble understanding the following concepts when it comes to programming.Method
Object
Encapsulation
Signal
Operation
Data Element
Data Structure
List
Stack
Queue
My Question is; what is the basic terminology for each of these and how would they apply to programming. If you could also show a basic code and describe its function, that would be amazingly helpful. Thank you
Explanation / Answer
Method: This stands for the functions that are embedded in you class files. Like for example: class student{ private: int roll_no; public: void addStudent(); } Here addStudent is a method!!! 2. Object Now when u define a variable from your class file then it is called an object! That is an instance of a class is known as object eg:- student s= new student(); Here, s is the object! 3.Encapsulation Now this is basically data hiding! In the above class that I have defined the attribute /property roll_no cannot be accessed directly 4.Signal Any entity that gives a value of the independent variable or behaviour of the system! 5.Operation An operation is the use of a function to process an input variable! for eg:- c=add(2,2); 6.Data Structure: It can be defined as way to represent data object or element. Eg: Linear Linked List, Binary Tree!! 7.Data Element : The data inside a data structure. for eg: if 2 is inside a stack data structure the 2 is the data element! 8.List: List can be seen as a linear(straight ) chain of data object related to each other via use of pointers or some reference. eg: 2->3->4->5->NULL this is a linked list and it contains a data value and a right pointer to point to next value! For termination the null value is used! 9.Stack: Stack is a Last In first out data structure. this means that the data sent at last is retrieved or taken out first! It has basically 2 operations push and pop! eg: we have a stack like 2 3 4 then push(3) will result to be 3 2 3 4 and pop() operation will result to be val=pop()//This gives 2 as return value ! ie val=2 The stack will look like 3 4 10.Queue:It is a First In First out data structure! In this the the data provide first comes out first! Think of it as the pipe containing water then the water sent from first end will come out first! Substitute water with data and you get a queue!! Hope this help!!if you need any more help mail me @sanjeev180@yahoo.com
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.