Monday, December 26, 2022

Exception Handling in C++ & Void pointer

 #include <iostream>

using namespace std;


int sum(int a,int b) throws (int,char)

{

    if(a<0 && b<0)

    throw  0;

    cout<<(a+b)<<endl;

}


int main()

{

    int age;

    cout<<"Enter age?";

    cin>>age;

    try{

        if(age<0)

        throw 0;

        else

            if(age>100)

            throw 'x';

            else

                if(age==0)

                {

                    throw 0.0;

                }

                else

                if(age==100){

                    throw "oho!";

                }

      cout<<"Age = "<<age<<endl;   

    }

    catch(char ch) //handler prog

    { 

        cerr<<"Illegal age";

    }

    catch(int ch) //handler prog

    { 

        cerr<<"Age can't be negative";

    }

    catch(float f){

        cerr<<"Age can't be zero";

    }

    catch(char *str){

        cout<<str;

    }

   catch(...) //default handler

   {

      

       cout<<"Unknown error "<<endl;

   }

    return 0;

}

---------------------------------------------------------------------------------

void pointer example

#include <iostream>

using namespace std;




int main(void)

{

    int no=100;

    float f=10.345F;

    void*n;

    n=&f;

    cout<<*(float*)n<<endl;

    return 0;

}




Wednesday, November 2, 2022

Inheritance simple,multi level and code reusability

//Simple inheritance

#include <iostream>

using namespace std;

//base class

class Student

{

    protected:

        int sno;

        char sname[20];

};

// derived clasds

class Mpc:public Student

{

    private:

        int maths,phy,che;

    public:

        void get()

        {

            cout<<"Enter no and name?";

            cin>>sno>>sname;

            cout<<"Enter Maths,phy & che marks?";

            cin>>maths>>phy>>che;

        }

        void dis(){

            cout<<sno<<"\t\t"<<sname<<endl;

            cout<<maths<<"\t\t"<<phy<<"\t\t"<<che<<"\n";

        }

            

    

};


int main()

{

    Mpc obj;

    cout<<sizeof(obj)<<endl;

    obj.get();

    obj.dis();

    return 0;

}





// multi level inheritance

#include <iostream>

using namespace std;

//base class

class Student

{

    protected:

        int sno;

        char sname[20];

};

// derived class

class Lang:public Student{

    protected:

        int eng,tel;

};

// derived clasds

class Mpc:public Lang

{

    private:

        int maths,phy,che;

    public:

        void get()

        {

            cout<<"Enter no and name?";

            cin>>sno>>sname;

            cout<<"Enter eng and tel marks?";

            cin>>eng>>tel;

            cout<<"Enter Maths,phy & che marks?";

            cin>>maths>>phy>>che;

        }

        void dis(){

            cout<<sno<<"\t\t"<<sname<<endl;

            cout<<eng<<"\t\t"<<tel<<"\n";

            cout<<maths<<"\t\t"<<phy<<"\t\t"<<che<<"\n";

        }

};


int main()

{

    Mpc obj;

    cout<<sizeof(obj)<<endl;

    obj.get();

    obj.dis();

    return 0;

}


output :

Enter no and name?101 Scott

Enter eng and tel marks?66 77

Enter Maths,phy & che marks?88 99 90

101             Scott

66              77

88              99              90


-------------------------

// multi level multi line inheritance

#include <iostream>

using namespace std;

//base class

class Student

{

    protected:

        int sno;

        char sname[20];

};

// derived class

class Lang:public Student{

    protected:

        int eng,tel;

};

//derived class

class Pc:public Lang{

    protected:

        int phy,che;

};

// derived clasds

class Mpc:public Pc

{

    private:

        int maths;

    public:

        void get()

        {

            cout<<"Enter no and name?";

            cin>>sno>>sname;

            cout<<"Enter eng and tel marks?";

            cin>>eng>>tel;

            cout<<"Enter Maths,phy & che marks?";

            cin>>maths>>phy>>che;

        }

        void dis(){

            cout<<sno<<"\t\t"<<sname<<endl;

            cout<<eng<<"\t\t"<<tel<<"\n";

            cout<<maths<<"\t\t"<<phy<<"\t\t"<<che<<"\n";

        }

};

// derived clasds

class Bpc:public Pc

{

    private:

        int bot,zoo,phy,che;

    public:

        void get()

        {

            cout<<"Enter no and name?";

            cin>>sno>>sname;

            cout<<"Enter eng and tel marks?";

            cin>>eng>>tel;

            cout<<"Enter phy,che,bot & zoo marks?";

            cin>>phy>>che>>bot>>zoo;

        }

        void dis(){

            cout<<sno<<"\t\t"<<sname<<endl;

            cout<<eng<<"\t\t"<<tel<<"\n";

            cout<<bot<<"\t\t"<<phy<<"\t\t"<<che<<"\t\t"<<zoo<<"\n";

        }

};

int main()

{

    Mpc m;

    m.get();

    m.dis();

    Bpc b;

    b.get();

    b.dis();

    return 0;

}


Enter no and name?101 Babe

Enter eng and tel marks?45 56

Enter Maths,phy & che marks?56 67 78

101             Babe

45              56

56              67              78

Enter no and name?102 Scott

Enter eng and tel marks?78 76

Enter phy,che,bot & zoo marks?56 56 56 56

102             Scott

78              76

56              56              56              56


---------------------------------------------------------

// concept of reusability of code

#include <iostream>

using namespace std;

//base class

class Student

{

    protected:

        int sno;

        char sname[20];

    public:

        void get(){

            cout<<"Enter no and name?";

            cin>>sno>>sname;

        }

        void dis(){

            cout<<sno<<"\t\t"<<sname<<endl;

        }

};

// derived class

class Lang:public Student{

    protected:

        int eng,tel;

    public:

        void get(){

            Student::get();

            cout<<"Enter eng and tel marks?";

            cin>>eng>>tel;

        }

        void dis(){

            Student::dis();

            cout<<eng<<"\t\t"<<tel<<"\n";

        }

};

//derived class

class Pc:public Lang{

    protected:

        int phy,che;

    public:

        void get(){

            Lang::get();

            cout<<"Enter Phy and che marks?";

            cin>>phy>>che;

        }

        void dis(){

            Lang::dis();

            cout<<phy<<"\t\t"<<che<<"\n";

        }

};

// derived clasds

class Mpc:public Pc

{

    private:

        int maths;

    public:

        void get()

        {

            Pc::get();

            cout<<"Enter Maths marks?";

            cin>>maths;

        }

        void dis(){

            Pc::dis();

            cout<<maths<<"\n";

        }

};

// derived clasds

class Bpc:public Pc

{

    private:

        int bot,zoo;

    public:

        void get()

        {

            Pc::get();

            cout<<"Enter bot & zoo marks?";

            cin>>bot>>zoo;

        }

        void dis(){

            Pc::dis();

            cout<<bot<<"\t\t"<<zoo<<"\n";

        }

};

int main()

{

    Mpc m;

    m.get();

    m.dis();

    Bpc b;

    b.get();

    b.dis();

   

    return 0;

}


output:

Enter no and name?101 Babe

Enter eng and tel marks?55 55

Enter Phy and che marks?66 66

Enter Maths marks?78

101             Babe

55              55

66              66

78

Enter no and name?102 Tiger

Enter eng and tel marks?67 78

Enter Phy and che marks?78 89

Enter bot & zoo marks?78 78

102             Tiger

67              78

78              89

78              78


Thursday, September 22, 2022

R20 CPP UNIT WISE QUESTIONS

Note  :( These questions are just to put you in understanding level )

UNIT-1  

Differentiate between procedural and object oriented approach. (7M)

What is an object? How is it different from an ordinary variable and a class?
Explain with an example.

State the important features of object oriented programming. (7M)

Describe the major parts of C++ Program.

Compare object oriented programming with procedure oriented programming. 

Compare the features of C Programming language to that of C++ Programming
language.

Mention advantages and disadvantages of object oriented programming over
functional programming.

Explain the following concepts used in object oriented paradigm. Message
passing, code reusability.

What are the drawbacks of conventional programming? Explain how object oriented
programming overcome them.

Explain polymorphism, data abstraction and data encapsulation with examples.

List the drawbacks of conventional programming. Explain how object oriented
programming overcome them.

Explain about polymorphism and encapsulation.

List the similarities and differences between C and C++.

Write about inheritance and abstraction.

Explain the key concepts of Object Oriented Programming.

Briefly write about the evolution of C++.

UNIT-2

Write a C++ program demonstrating the viability of new and delete operators for a
single variable as well as an array.

How will you destroy the objects initialized by the constructor in the program?

With an example explain the syntax for defining a class. 

What is function overloading? What are the principles of function overloading?

How memory is allocated to an object? State with an example.

Write a C++ program to define two overloaded functions to swap two integers and to
swap two characters.

How the member function can be defined inside class and outside the class?
Explain.

Write a program in C++ to find the factorial of a given number using recursion.

What is static function? What is its use? How a member of class be declared as
static?

Write a C++ program to define three overloaded functions to swap two integers, swap two
floats and swap two doubles.

What are recursive constructors? Explain with an example.

Define inline function. Write a C++ program for finding the area of a triangle using
inline functions.

What is function overloading? What are the principles of function overloading?

Write C++ Program that demonstrates the usage of static data member and static
member function.

Write C++ program to find the area of a circle, rectangle and triangle using
function overloading.

What is a constructor? Write different rules associated with declaring constructors.

UNIT-3

What is operator overloading? Write the rule to overload an operator.

What are the various types of situations that might arise in data conversion
between incompatible types? How can they be handled? 
Explain the visibility of base class members for the access specifiers: private, protected
and public while creating the derived class and also explain the syntax for creating
derived class.

Write a C++ program to exchange the values between two classes using friend
functions.

Describe various visibility modes available in C++. 

With an example, explain the syntax for passing arguments to base class constructors in
multiple inheritances.

Write a C++ program to overload binary ‘+’ operator which will add two complex
numbers of the form (a+ib).

Write a C++ program to implement multiple inheritances with public access specific.

Write C++ program to find the area of a circle, rectangle and triangle using
function overloading.

What is a constructor? Write different rules associated with declaring constructors.

What are different types of inheritance supported by C++? Give an example for
each.

Write a C++ program to overload increment operator.

Write a C++ program to demonstrate pointers to base and derived classes. 

Discuss about virtual functions with a C++ example.

UNIT-4

With an example, explain how virtual functions are hierarchical.

How to create a virtual destructor? What is the necessity of making it virtual?

Describe the mechanism of creating virtual functions in C++ with an example.

Write a C++ program that declare and use pointer to an object.

How virtual functions can be used to implement runtime polymorphism? Describe.

What is a pointer? How to declare a pointer to a class and an object?

How does polymorphism promote extensibility? Illustrate.

With an example explain how late binding can be achieved in C++.

What is dynamic binding? How it is different from static binding? List some
advantages of dynamic binding over static binding.

What is a virtual destructor? Explain with an example.

Explain the role of this pointer in C++ with a programming example.

UNIT-5

Write a C++ program that illustrates exception handling with the help of
keywords: try, throws and catch.

What is STL? Briefly explain the use of containers, vectors, lists and maps.

What are class templates? How are they different from classes? Explain with
sample C++ code.

hat should be placed inside try block and catch block? When do you use
multiple catch handlers?

Write a C++ program to insert elements into a list. 

What is a container? Give its significance. Give an overview on its types.

Can we overload a function template? Illustrate with an example.

What is the sequence of events when an exception occurs? Explain them. 

How to initialize elements of vectors and lists? Illustrate. 

What is the use of Iterator while using containers? Justify with an example.

What are macros? How are they different from preprocessor directives and templates? (7M)

Write a program to swap two variables using a function template. 

Explain briefly the three foundational items of standard template library.

Write a C++ program to add two integers, two floating point numbers and two
complex numbers using class templates. 

Explain how to catch multiple exceptions in C++.

Wednesday, August 3, 2022

PYTHON DS BASICS

 

PYTHON DS

General Data Structures

The various data structures in computer science are divided broadly into two categories shown below. We will discuss about each of the below data structures in detail in subsequent chapters.

Liner Data Structures

These are the data structures which store the data elements in a sequential manner.

·         Array − It is a sequential arrangement of data elements paired with the index of the data element.

·         Linked List − Each data element contains a link to another element along with the data present in it.

·         Stack − It is a data structure which follows only to specific order of operation. LIFO(last in First Out) or FILO(First in Last Out).

·         Queue − It is similar to Stack but the order of operation is only FIFO(First In First Out).

·         Matrix − It is two dimensional data structure in which the data element is referred by a pair of indices.

Non-Liner Data Structures

These are the data structures in which there is no sequential linking of data elements. Any pair or group of data elements can be linked to each other and can be accessed without a strict sequence.

·         Binary Tree − It is a data structure where each data element can be connected to maximum two other data elements and it starts with a root node.

·         Heap − It is a special case of Tree data structure where the data in the parent node is either strictly greater than/ equal to the child nodes or strictly less than it’s child nodes.

·         Hash Table − It is a data structure which is made of arrays associated with each other using a hash function. It retrieves values using keys rather than index from a data element.

·         Graph − It is an arrangement of vertices and nodes where some of the nodes are connected to each other through links.

Python Specific Data Structures

These data structures are specific to python language and they give greater flexibility in storing different types of data and faster processing in python environment.

·         List − It is similar to array with the exception that the data elements can be of different data types. You can have both numeric and string data in a python list.

·         Tuple − Tuples are similar to lists but they are immutable which means the values in a tuple cannot be modified they can only be read.

·         Dictionary − The dictionary contains Key-value pairs as its data elements.

 

A linked list is a sequence of data elements, which are connected together via links. Each data element contains a connection to another data element in form of a pointer. Python does not have linked lists in its standard library. We implement the concept of linked lists using the concept of nodes as discussed in the previous chapter.

We have already seen how we create a node class and how to traverse the elements of a node.In this chapter we are going to study the types of linked lists known as singly linked lists. In this type of data structure there is only one link between any two data elements. We create such a list and create additional methods to insert, update and remove elements from the list.

Creation of Linked list

We create a Node object and create another class to use this ode object. We pass the appropriate values through the node object to point the to the next data elements. The below program creates the linked list with three data elements. In the next section we will see how to traverse the linked list.

class Node:

   def __init__(self, dataval=None):

      self.dataval = dataval

      self.nextval = None

 

class SLinkedList:

   def __init__(self):

      self.headval = None

 

list1 = SLinkedList()

list1.headval = Node("Mon")

e2 = Node("Tue")

e3 = Node("Wed")

# Link first Node to second node

list1.headval.nextval = e2

 

# Link second Node to third node

e2.nextval = e3

Traversing a Linked List

Singly linked lists can be traversed in only forward direction starting form the first data element. We simply print the value of the next data element by assigning the pointer of the next node to the current data element.

Example

class Node:

   def __init__(self, dataval=None):

      self.dataval = dataval

      self.nextval = None

 

class SLinkedList:

   def __init__(self):

      self.headval = None

 

   def listprint(self):

      printval = self.headval

      while printval is not None:

         print (printval.dataval)

         printval = printval.nextval

 

list = SLinkedList()

list.headval = Node("Mon")

e2 = Node("Tue")

e3 = Node("Wed")

 

# Link first Node to second node

list.headval.nextval = e2

 

# Link second Node to third node

e2.nextval = e3

 

list.listprint()

Output

When the above code is executed, it produces the following result −

Mon

Tue

Wed

 

 

Insertion in a Linked List

Inserting element in the linked list involves reassigning the pointers from the existing nodes to the newly inserted node. Depending on whether the new data element is getting inserted at the beginning or at the middle or at the end of the linked list, we have the below scenarios.

Inserting at the Beginning

This involves pointing the next pointer of the new data node to the current head of the linked list. So the current head of the linked list becomes the second data element and the new node becomes the head of the linked list.

Example

class Node:
   def __init__(self, dataval=None):
      self.dataval = dataval
      self.nextval = None
 
class SLinkedList:
   def __init__(self):
      self.headval = None
# Print the linked list
   def listprint(self):
      printval = self.headval
      while printval is not None:
         print (printval.dataval)
         printval = printval.nextval
   def AtBegining(self,newdata):
      NewNode = Node(newdata)
 
# Update the new nodes next val to existing node
   NewNode.nextval = self.headval
   self.headval = NewNode
 
list = SLinkedList()
list.headval = Node("Mon")
e2 = Node("Tue")
e3 = Node("Wed")
 
list.headval.nextval = e2
e2.nextval = e3
 
list.AtBegining("Sun")
list.listprint()

Output

When the above code is executed, it produces the following result −

Sun
Mon
Tue
Wed

Inserting at the End

This involves pointing the next pointer of the the current last node of the linked list to the new data node. So the current last node of the linked list becomes the second last data node and the new node becomes the last node of the linked list.

Example

class Node:
   def __init__(self, dataval=None):
      self.dataval = dataval
      self.nextval = None
class SLinkedList:
   def __init__(self):
      self.headval = None
# Function to add newnode
   def AtEnd(self, newdata):
      NewNode = Node(newdata)
      if self.headval is None:
         self.headval = NewNode
         return
      laste = self.headval
      while(laste.nextval):
         laste = laste.nextval
      laste.nextval=NewNode
# Print the linked list
   def listprint(self):
      printval = self.headval
      while printval is not None:
         print (printval.dataval)
         printval = printval.nextval
 
list = SLinkedList()
list.headval = Node("Mon")
e2 = Node("Tue")
e3 = Node("Wed")
 
list.headval.nextval = e2
e2.nextval = e3
 
list.AtEnd("Thu")
 
list.listprint()

Output

When the above code is executed, it produces the following result −

Mon
Tue
Wed
Thu

 

Inserting in between two Data Nodes

This involves changing the pointer of a specific node to point to the new node. That is possible by passing in both the new node and the existing node after which the new node will be inserted. So we define an additional class which will change the next pointer of the new node to the next pointer of middle node. Then assign the new node to next pointer of the middle node.

class Node:
   def __init__(self, dataval=None):
      self.dataval = dataval
      self.nextval = None
class SLinkedList:
   def __init__(self):
      self.headval = None
 
# Function to add node
   def Inbetween(self,middle_node,newdata):
      if middle_node is None:
         print("The mentioned node is absent")
         return
 
      NewNode = Node(newdata)
      NewNode.nextval = middle_node.nextval
      middle_node.nextval = NewNode
 
# Print the linked list
   def listprint(self):
      printval = self.headval
      while printval is not None:
         print (printval.dataval)
         printval = printval.nextval
 
list = SLinkedList()
list.headval = Node("Mon")
e2 = Node("Tue")
e3 = Node("Thu")
 
list.headval.nextval = e2
e2.nextval = e3
 
list.Inbetween(list.headval.nextval,"Fri")
 
list.listprint()

Output

When the above code is executed, it produces the following result −

Mon
Tue
Fri
Thu

Removing an Item

We can remove an existing node using the key for that node. In the below program we locate the previous node of the node which is to be deleted.Then, point the next pointer of this node to the next node of the node to be deleted.

Example

class Node:
   def __init__(self, data=None):
      self.data = data
      self.next = None
class SLinkedList:
   def __init__(self):
      self.head = None
 
   def Atbegining(self, data_in):
      NewNode = Node(data_in)
      NewNode.next = self.head
      self.head = NewNode
 
# Function to remove node
   def RemoveNode(self, Removekey):
      HeadVal = self.head
         
      if (HeadVal is not None):
         if (HeadVal.data == Removekey):
            self.head = HeadVal.next
            HeadVal = None
            return
      while (HeadVal is not None):
         if HeadVal.data == Removekey:
            break
         prev = HeadVal
         HeadVal = HeadVal.next
 
      if (HeadVal == None):
         return
 
      prev.next = HeadVal.next
         HeadVal = None
 
   def LListprint(self):
      printval = self.head
      while (printval):
         print(printval.data),
         printval = printval.next
 
llist = SLinkedList()
llist.Atbegining("Mon")
llist.Atbegining("Tue")
llist.Atbegining("Wed")
llist.Atbegining("Thu")
llist.RemoveNode("Tue")
llist.LListprint()

Output

When the above code is executed, it produces the following result −

Thu
Wed
Mon

 LINKED LIST (OWN SIMPLE EXAMPLE)

 

class Node:

    def __init__(self,data=None):

        self.data=data

        self.next=None

       

class LinkList:

    def __init__(self):

        self.head=None

       

    def printnodes(self):

        curr=self.head

        while curr!=None:

            print(curr.data,'  ')

            curr=curr.next

   

    def insertbeg(self,node): 

        node.next=self.head

        self.head=node

   

    def insertend(self,node):

        prev=self.head

        curr=self.head

        while curr!=None:

            prev=curr

            curr=curr.next

        prev.next=node               

 

 

l=LinkList()

first=Node("mon")

l.head=first

 

n1=Node("tue")

 

first.next=n1

n2=Node("wed")

n1.next=n2

 

l.printnodes()

print("-----")

l.insertbeg(Node("Sun"))

l.printnodes()

print("-----")

 

l.insertend(Node("Over"))

l.printnodes()

 

output

 

mon  

tue  

wed  

-----

Sun  

mon  

tue  

wed  

-----

Sun  

mon  

tue  

wed  

Over         

        

Python - Stack

 

In the english dictionary the word stack means arranging objects on over another. It is the same way memory is allocated in this data structure. It stores the data elements in a similar fashion as a bunch of plates are stored one above another in the kitchen. So stack data strcuture allows operations at one end wich can be called top of the stack.We can add elements or remove elements only form this en dof the stack.

In a stack the element insreted last in sequence will come out first as we can remove only from the top of the stack. Such feature is known as Last in First Out(LIFO) feature. The operations of adding and removing the elements is known as PUSH and POP. In the following program we implement it as add and and remove functions. We declare an empty list and use the append() and pop() methods to add and remove the data elements.

PUSH into a Stack

Let us understand, how to use PUSH in Stack. Refer the program mentioned program below −

Example

class Stack:
   def __init__(self):
      self.stack = []
 
   def add(self, dataval):
# Use list append method to add element
      if dataval not in self.stack:
         self.stack.append(dataval)
         return True
      else:
         return False
# Use peek to look at the top of the stack
   def peek(self):     
                       return self.stack[-1]
 
AStack = Stack()
AStack.add("Mon")
AStack.add("Tue")
AStack.peek()
print(AStack.peek())
AStack.add("Wed")
AStack.add("Thu")
print(AStack.peek())

Output

When the above code is executed, it produces the following result −

Tue
Thu

POP from a Stack

As we know we can remove only the top most data element from the stack, we implement a python program which does that. The remove function in the following program returns the top most element. we check the top element by calculating the size of the stack first and then use the in-built pop() method to find out the top most element.

class Stack:
   def __init__(self):
      self.stack = []
 
   def add(self, dataval):
# Use list append method to add element
      if dataval not in self.stack:
         self.stack.append(dataval)
         return True
      else:
         return False
        
# Use list pop method to remove element
   def remove(self):
      if len(self.stack) <= 0:
         return ("No element in the Stack")
      else:
         return self.stack.pop()
 
AStack = Stack()
AStack.add("Mon")
AStack.add("Tue")
AStack.add("Wed")
AStack.add("Thu")
print(AStack.remove())
print(AStack.remove())

Output

When the above code is executed, it produces the following result −

Thu
Wed

STACK PUSH,POP Example
 class Stack:
   def __init__(self):
      self.stack = []
    def add(self, dataval):
# Use list append method to add element
      if dataval not in self.stack:
         self.stack.append(dataval)
         return True
      else:
         return False
# Use peek to look at the top of the stack
   def peek(self):     
                       return self.stack[-1]
 
   def printall(self):
       print(self.stack)
        
   def remove(self):
       if len(self.stack)<=0:
           print("Stack is emp[ty")
       else:
           return self.stack.pop()
       
       
             
AStack = Stack()
AStack.add("Mon")
AStack.add("Tue")
AStack.add('Mon')
AStack.add("Wed")
AStack.add("Thu")
AStack.add('Fri')
AStack.printall()
 
print(AStack.peek())
 AStack.remove()
AStack.printall()

Output:

['Mon', 'Tue', 'Wed', 'Thu', 'Fri']

Fri

['Mon', 'Tue', 'Wed', 'Thu']


QUEUE :

class Queue: def __init__(self): self.queue = [] def add(self, dataval): # Use list append method to add element if dataval not in self.queue: self.queue.append(dataval) return True else: return False # Use peek to look at the top of the queue def peek(self): return self.queue[-1] def printall(self): print(self.queue) def remove(self): if len(self.queue)<=0: print("queue is emp[ty") else: return self.queue.pop(0) def addbeg(self,wd): self.queue.insert(0, wd) Queue = Queue() Queue.add("Mon") Queue.add("Tue") Queue.add('Mon') Queue.add("Wed") Queue.add("Thu") Queue.add('Fri') Queue.addbeg('Sunday') Queue.printall() print(Queue.peek()) Queue.remove() Queue.printall()

Output:

['Sunday', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri'] Fri ['Mon', 'Tue', 'Wed', 'Thu', 'Fri']